Is there anything wrong in WPF with setting the Owner property of a window to its parent in that parent\'s constructor? There shouldn\'t be, right? So why am I getting an
I ended up subscribing to Window.Activated
, not Window.StateChanged
. Be sure to unsubscribe to it in the handler, as advised in the comments.
private void OnActivated(object sender, EventArgs eventArgs)
{
owned.Owner = this;
Activated -= OnActivated;
}
I accepted dlev's answer because it led me directly to finding the answer, even if his didn't work for my exact situation.