private void ButtonAddClick(object sender, RoutedEventArgs e) { ButtonsEnabled = false; var dialog = new AddFeed(); dialog.Show(DialogPlaceHolder); dialog.OnClose += (o, result) => { ButtonsEnabled = true; dialog.Dispose(); }; }