void BtnLoad_Click(object sender, RoutedEventArgs e) { Button thisButton = sender as Button; if (thisButton.Content != null) { ConfirmWindow confirmWindow = new ConfirmWindow("Вы действительно хотите загрузить это сохранение?"); if (confirmWindow.ShowDialog() == false) { return; } } LoadProcess(thisButton.Content.ToString()); }
void BtnSave_Click(object sender, RoutedEventArgs e) { thisButton = sender as Button; if (textBox != null) { return; } if (thisButton.Content != null) { ConfirmWindow confirmWindow = new ConfirmWindow("Вы действительно хотите перезаписать это сохранение?"); if (confirmWindow.ShowDialog() == false) { return; } } buttonName = thisButton.Name; SaveProcess(); }