private static void HistoryTrackerChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
        {
            UndoRedoButtonBase sb = (UndoRedoButtonBase)dependencyObject;

            if (dependencyPropertyChangedEventArgs.OldValue != null)
            {
                HistoryTracker ht = (HistoryTracker)dependencyPropertyChangedEventArgs.OldValue;
                ht.UndoOperationsChanged -= sb.HistoryTrackerOnOperationsChanged;
                ht.RedoOperationsChanged -= sb.HistoryTrackerOnOperationsChanged;
            }

            if (dependencyPropertyChangedEventArgs.NewValue != null)
            {
                sb.HistoryTracker.UndoOperationsChanged += sb.HistoryTrackerOnOperationsChanged;
                sb.HistoryTracker.RedoOperationsChanged += sb.HistoryTrackerOnOperationsChanged;
            }

            sb.SetOperations();
            sb.CoerceValue(UIElement.IsEnabledProperty);
        }
 public UndoRedoCommand(UndoRedoButtonBase undoRedoButtonBase, bool undo)
 {
     this.undoRedoButtonBase = undoRedoButtonBase;
     this.undo = undo;
 }
 public UndoRedoCommand(UndoRedoButtonBase undoRedoButtonBase, bool undo)
 {
     this.undoRedoButtonBase = undoRedoButtonBase;
     this.undo = undo;
 }