Click here to Skip to main content
15,891,864 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I have 3 xaml file as below mentioned:

1. MainWindow.xaml
2. UserControl1.xaml
3. UserControl2.xaml


In UserControl1.xaml one button is there.

In Main Window I am displaying the user control in ContentControl. Once UserControl1.xaml is displayed and after that If I click on the button UserControl1.xaml should be invisible and UserControl2.xaml should be dislayed in the same ContentControl.

So I am little bit confused how to do this?

In short my query is :

Showing User control from another user control's button click in Main Window
Posted

1 solution

private void Press_Click(object sender, RoutedEventArgs e)
{
window2 win2= new window2();
win2.Show();
this.Close();
}
private void Press1_Click(object sender, RoutedEventArgs e)
{
window3 win3= new window3();
win3.Show();
this.Close();
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900