Declare in your background code following:
Private Visibility _vis_UC_2;
Public Visibility vis_UC2
{
get
{
return _vis_UC2;
}
set
{
_vis_UC2 = value;
OnPropertyChanged("vis_UC2");
}
}
Don't forget to add INotifyPropertyChanged
to your class
Then you bind your UserControl's visibility to vis_UC2.
In Constructor set starting visibility such as following
Public Void MainWindow()
{
InitializeCompotenents();
vis_UC2 = Visibility.Collapsed;
}
and finally under your button click you only say the following:
vis_UC2 = Visibility.Visible;