Binding the “WindowState” property of a window in WPF using MVVM

后端 未结 3 1032
盖世英雄少女心
盖世英雄少女心 2021-01-12 06:01

I bound the \"WindowState\" property of my main window to my ViewModel in order to change the state of the window by a command, but the first time I minimize the window it m

3条回答
  •  南笙
    南笙 (楼主)
    2021-01-12 06:25

    Another option to consider is subscribing both via a command AND an event to code behind, e.g:

        
    

    The command in this case affects the VM. The Click event, only changes the Window state.

提交回复
热议问题