How to restore a minimized Window in code-behind?

后端 未结 7 923
无人共我
无人共我 2020-12-08 06:24

This is somewhat of a mundane question but it seems to me there is no in-built method for it in WPF. There only seems to be the WindowState property which being

7条回答
  •  难免孤独
    2020-12-08 06:49

    SystemCommands class has a static method called RestoreWindow that restores the window to previous state.

    SystemCommands.RestoreWindow(this); // this being the current window
    

    [Note : SystemCommands class is part of .NET 4.5+ (MSDN Ref) for projects that target to earlier versions of Framework can use the WPF Shell extension (MSDN Ref)]

提交回复
热议问题