public BehaviorToolButton(Behavior behavior) { ParentBehavior = behavior; behavior.PropertyChanged += behavior_PropertyChanged; buttonGrid = new ButtonGrid(behavior.Icon, behavior.Name); buttonGrid.IconTextGap = IconTextGap; Content = buttonGrid; buttonGrid.MouseLeftButtonDown += buttonGrid_MouseLeftButtonDown; }
public CommandToolButton(Command command) { Command = command; command.AddObserver(this); buttonGrid = new ButtonGrid(command.Icon, command.Name); if (command.Icon is CheckBox) { command.Icon.IsHitTestVisible = false; } Content = buttonGrid; buttonGrid.MouseLeftButtonDown += Content_MouseLeftButtonDown; }