private static void OnPaletteChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { PaletteControl control = (PaletteControl)d; control.OnPaletteChanged((IPalette)e.OldValue, (IPalette)e.NewValue); }