c# - Set Window owner inside of an UserControl in WPF -
i have usercontrol
shows window without icon in taskbar, problem when main window lost focus , again window without taskbar icon behind main window , difficult show in front again, issue solved using window.owner = this;
when class window, when usercontrol
or other type (e.g. listboxitem
, viewbox
) can't this. tried control.owner = (window)this;
result throws exception grid
cannot converted window
use
window.owner = window.getwindow(this);