Tuesday, January 29, 2013

Find Window where UserControl is hosted


public partial class PopupUserControl : UserControl
    {

        private void btnOK_Click(object sender, RoutedEventArgs e)
        {
            var owner = Window.GetWindow(this); 
          owner.Close();          
        }
    }

No comments:

Post a Comment