protected virtual void CloseFile() { //Prepare bool remove = true; //Check if (IsDirty) { //Get result MessageBoxResult result = MessageBox.Show($"Save changes to {DisplayName}?", "Unsaved Changes", MessageBoxButton.YesNoCancel, MessageBoxImage.Information); //Handle switch (result) { case MessageBoxResult.Cancel: remove = false; break; case MessageBoxResult.Yes: SaveToFile(); break; } } //Check and remove if (remove) { CloseCallback?.Invoke(this); } }
public virtual void Close() { CloseCallback?.Invoke(); }
public override void Close(bool shouldCloseImmediately = false) { _shouldCloseImmediately = shouldCloseImmediately; CloseCallback?.Invoke(); }
private void OnCloseButtonClick(object sender, RoutedEventArgs e) { CloseCallback.Invoke(); }
public override void OnPointerClick(PointerEventData eventData) { CloseCallback?.Invoke(); }