wpf - Close View From viewModel using MVVM or without ViewModel -


When the user clicks on the close button (x) at the click or I just want to know something like the application quayand,

Yes, an application is a comma. Close and use only this as a suggestion: anywhere you have a close button, bind it to the application command. Turn it Off:

  & lt; Button content = "{StaticResource CloseX}" command = "shutdown" />  

Now in your base class you use your ideas, register the event handler for this command and when it sets a fire, remove the view from her parents. Or otherwise close the view. The description of how to do this depends on how your view windows are managed, if each view is an independent window, just close the window. But if a visual manager manages the layout, then delete that scene.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -