Hide WPF Window Until Fully Loaded

前端 未结 4 561
情话喂你
情话喂你 2021-01-02 15:10

For my WPF application, I am storing several user settings like window position, window state, and whether or not to display a welcome dialog. The problem is that while eve

4条回答
  •  萌比男神i
    2021-01-02 15:40

    There are functions , BeginInit and EndInit, if you change properties inside these functions like..

    BeginInit();
    ...
    ... // Do your code Initialization here...
    ...
    EndInit();
    

    then your window will not render until the EndInit() is called, it will not flicker.

提交回复
热议问题