I am trying to access parent window from user control.
userControl1 uc1 = new userControl1(); mainGrid.Children.Add(uc1); through this code I load userControl1 to main grid.
But when I click on a button inside userControl1 then I want to load another userControl2 into mainGrid which is in main window?
Have you tried
Window yourParentWindow = Window.GetWindow(userControl1);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With