public void SaveAll(object sender, RoutedEventArgs e) { foreach (object o in tabControl.Items) { Editors.Editor edit = (Editors.Editor)o; edit.Save(); } }
public void CloseFile(object sender, RoutedEventArgs e) { Editors.Editor edit = ((Editors.Editor)((TabItem)tabControl.SelectedItem).Content); if (!edit.IsSaved) { MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show("Would you like to save before closing?", "File Not Saved", System.Windows.MessageBoxButton.YesNo); if (messageBoxResult == MessageBoxResult.Yes) { edit.Save(); } } tabControl.Items.Remove(tabControl.SelectedItem); }
public void SaveFile(object sender, RoutedEventArgs e) { Editors.Editor edit = ((Editors.Editor)((TabItem)tabControl.SelectedItem).Content); edit.Save(); }