In WPF MVVM application, UserControls are reloaded after Remote Desktop Connection to pc that appplication is running, after that we got stuck in some problems.I read this link about WPF, but I cannot resolve this issue.
There is an ItemsControl
that UserControl
s are added to:
<ItemsControl ItemsSource="{Binding CamerasList}" x:Name="AllCamerasControl">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<local:SingleView />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
The constructor of the UserControl
is as follows:
public SingleCameraView()
{
InitializeComponent();
DataContext = new SingleViewModel();
}
Can anyone tell me how I can resolve this issue?