Hi,
I´ve encountered following problem. My application should visualize variables of a machine. The user can select those variables an organize them in goups. For each group a SciChartSurface should be visualized with the selected variable as DataSeries.
Therefore I created a ViewModel for those groups. Holding them in a ObservableCollection wich is bound to an ItemsControl:
<ItemsControl
Grid.Row="1"
Grid.Column="1"
Grid.ColumnSpan="6"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
PreviewMouseWheel="XAxis_MouseWheel"
PreviewMouseUp="ListView_OnMiddleMouseUp"
d:PreviewKeyDown="ListView_OnPreviewKeyDown"
d:PreviewKeyUp="ListView_OnPreviewKeyUp"
ItemsSource="{Binding ChartViewModels}"
>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="1"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate DataType="traceControl:ChartViewModel">
<Grid
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
>
<s:SciChartSurface Loaded="ChartSurface_Loaded"
Unloaded="ChartSurface_Unloaded"
Background="White"
>
<!-- Some other stuff is also in here, modifiers and axissetup -->
</s:SciChartSurface>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
There is a Refresh-Action. It does clearing the the ViewModel Collection and creating new ViewModels depending on the configuration and fill them in the ViewModel Collection.
If both actionparts (clearing and filling data) were executed together in for example the ICommand of a button, the memory footprint is increasing each time the refresh button is hit.
If the actionparts were executed one by one, e.g. a clear button and a fill button, everything is fine.
Do I miss something?
Thanks in advance!
Markus
p.s. I was not allowed to add Screenshots of dotMemory
- Markus Kessler asked 6 years ago
- last active 6 years ago