I want to create 2 separate windows in xaml and I want to control them separately from the code part. Do you have any idea how to do that ? If you can provide some code examples, I will be appreciated.
Thank you from now…
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Add a second
Window(the first one being MainWindow.xaml) in your project (right click your project-> Add -> Window). Let’s call it BobbyWindow.In the constructor of MainWindow.xaml.cs, call:
voila.
EDIT: additional info to reflect the comments
The main difference between this:
And that:
Is that in the first case, bWin is local to the MainWindow() constructor, which means it only exists within the brackets of MainWindow().
In the second case, bWin is local to the class, which means it is only accessible from within the boundaries of the MainWindow class