public static void OnPrimaryButtonImagePathChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { ToggleMemoryButton button = d as ToggleMemoryButton; if (button != null) { button._button.ImagePath = (string)e.NewValue; } }
public static void OnCurrentIndexChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { ToggleMemoryButton button = d as ToggleMemoryButton; if (button != null) { button._label.Content = String.Format(button.DisplayFormat, button.CurrentIndex + 1) + (button.CurrentIndex < 1 ? "" : "s"); button._selectAll((int)e.NewValue); } }