In my WPF project I have a TabControl with several tab items. Each Tab Item has a WPF control (view) and each view has a correspondent ViewModel. Each time I click to change tab item I noticed that the control/view is unload and loaded again when I click the tab item again, the correspondent ViewModel stays in memory.
I m trying t build a simple RemoteDesktop/RDP client that uses 1 tab item per computer connection, so the problem is when I change tab item, the connection goes away because the view is unloaded...
I researched for some examples out there, but most of them are built in top of Winforms that has a different implementation from WPF.
So I was thinking if it is possible to prevent the View from going out of scope when I change from TabItem?
Does Any one knows about some sample online that uses WPF for tabbed RDP connections? Thank you.
UPDATE - DataTemplate being used
<DataTemplate DataType="{x:Type vm:DashboardViewModel}">
<v:DashboardView />
</DataTemplate>