private void AddWatcher_Click(object sender, RoutedEventArgs e) { IsEnabled = false; AddItemWindow window = new AddItemWindow { Owner = this }; window.Closing += (o, args) => { ReloadData(); IsEnabled = true; }; window.Owner = this; window.ShowDialog(); window.Activate(); window.Focus(); }
private void Edit_OnClick(object sender, RoutedEventArgs e) { MenuItem item = (MenuItem)sender; var gridView = (GridItem)item.DataContext; IsEnabled = false; var window = new AddItemWindow(gridView); window.Closing += (o, args) => { ReloadData(); IsEnabled = true; }; window.Owner = this; window.ShowDialog(); window.Activate(); window.Focus(); }