I am new to WPF and MVVM. I would like to minimize the window, not close it. In other words, I would like to cancel the Closingwindow event and minimize this window.
Closing
How do I do this MVVM?
If this is relevant, in the end I will install ShowInTaskbaron falseand use the WinForms tray component.
ShowInTaskbar
false
A common misunderstanding with MVVM is that there can never be code in a view. This is simply not true.
MVVM , , , (, Windows), -. - ViewModel - .
ViewModel, MVVM, ViewModel ( ).
:
e.Cancel = true; this.ShowInTaskbar = false; this.WindowState = WindowState.Minimized;