Having Trouble Setting Window's Owner in Parent's Constructor

后端 未结 4 1351
慢半拍i
慢半拍i 2021-02-12 14:25

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

4条回答
  •  滥情空心
    2021-02-12 14:51

    Just adding another option if you need the handle created earlier than normal for some reason, or can't show the window:

    new WindowInteropHelper(myWindow).EnsureHandle();

提交回复
热议问题