Access parent window from User Control

前端 未结 6 1168
感动是毒
感动是毒 2020-12-30 19:55

I am trying to access parent window from user control.

userControl1 uc1 = new userControl1();

mainGrid.Children.Add(uc1);

through this co

6条回答
  •  情深已故
    2020-12-30 20:54

    Thanks for help me guys. i got another solution

     ((this.Parent) as Window).Content = new userControl2();
    

    this is perfectly works

提交回复
热议问题