joi, 3 februarie 2011

WPF: How to set the parent control of a modal window?

WPF: How to set the parent control of a modal window?

Use the Owner  property of the Window class.

Sample:

ParentWindow _parentWindow;
...
ViewSetManagerWin _viewSetManagerCtrl = new ViewSetManagerWin();

viewSetManagerCtrl.Owner = _parentWindow;
 _viewSetManagerCtrl.ShowDialog();

Niciun comentariu:

Trimiteți un comentariu