How about this?
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
protected override void OnDeactivated(EventArgs e)
{
base.OnDeactivated(e);
Close();
}
}
More Related Contents:
- Open File Dialog MVVM
- WPF Get Element(s) under mouse
- WPF What is the correct way of using SVG files as icons in WPF
- In WPF, why doesn’t TemplateBinding work where Binding does?
- WPF: AutoComplete TextBox, …again
- ItemsControl with multiple DataTemplates for a viewmodel
- What’s the meaning of * (asterisk) in XAML ColumnDefinition?
- WPF – Making hyperlinks clickable
- How to get DataTemplate.DataTrigger to check for greater than or less than?
- What is the difference between a User Control Library and a Custom Control Library?
- How to find that ScrollViewer is scrolled to the end in WPF?
- How to free the memory after the BitmapImage is no longer needed?
- How to bind a TextBlock to a resource containing formatted text?
- Binding as a Resource
- Setters not run on Dependency Properties?
- Display a PDF in WPF Application [closed]
- WPF TextBox and Scroll behavior
- Finding control within WPF itemscontrol
- Disable WPF label accelerator key (text underscore is missing)
- How to increase scrollbar width in WPF ScrollViewer?
- What does “{Binding Path=.}” mean in WPF binding?
- What are the various WPF binding modes?
- WPF: Remove dotted border around focused item in styled listbox
- Binding a WPF DataGridComboBoxColumn with MVVM
- ValidationRule with ValidationStep=”UpdatedValue” is called with BindingExpression instead of updated value
- How to cancel an edit to an object using MVVM?
- InputBindings work only when focused
- Filter a DataGrid on a Text box
- WPF Visibility of a UI element based on combo selection
- WPF – How to create image button with template