Quantcast
Viewing all articles
Browse latest Browse all 18858

WPF Tab Control destorying Child Control state.

I am having an issue with the WPF tab control destroying the state of the child control.  The usercontrols placed in tabs are unloaded and loaded everytime i switch between tabs, to create slow lag in the application.

I have research a number of solutions, most of which are hacks or toolkits i would rather not integrate.

Is there an up to date, current solution that someone could recommend? Thanks

<TabControl IsSynchronizedWithCurrentItem="True"
ItemsSource="{Binding Workspaces}"
                        ItemTemplate="{StaticResource tabItem_Main}"
                        ItemContainerStyle="{StaticResource TabItemSummaryStyle}"
                        Height="1016">
                <TabControl.Template>
                    <ControlTemplate TargetType="{x:Type TabControl}">
                        <StackPanel>
                            <ScrollViewer
                                Style="{StaticResource TabstripScrollViewer}"
                                HorizontalScrollBarVisibility="Visible"
                                VerticalScrollBarVisibility="Hidden"
                                Margin="0,0,320,0"
                                Background="#373737"
                              >
                                <StackPanel Background="#212121" Orientation="Horizontal" IsItemsHost="True" Margin="0,0" />
                            </ScrollViewer>
        
                            <ContentPresenter ContentSource="SelectedContent" Margin="0,10,0,0" />
                        </StackPanel>
                    </ControlTemplate>
                </TabControl.Template>
            </TabControl>


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>