Pre loader

Tag: Itemscontrol

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0 votes
6k views

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

Showing 1 result

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies