private static void HandleColorListPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { PartBaseStateLED me = d as PartBaseStateLED; if (me != null) { string selectedColorsListString = (string)e.NewValue; if (me.colors.colorListString != selectedColorsListString) { me.colors = new Colors(selectedColorsListString); me.Update(); } } }
private static void HandleBorderWidthPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { PartBaseStateLED me = d as PartBaseStateLED; if (me != null) { double selectedWidth = (double)e.NewValue; if (me.lastBorderWidth != selectedWidth) { me.lastBorderWidth = selectedWidth; me.Update(); } } }
private static void HandleBorderThicknessPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { PartBaseStateLED me = d as PartBaseStateLED; if (me != null) { Thickness selectedThickness = (Thickness)e.NewValue; double selectedWidth = (selectedThickness.Bottom + selectedThickness.Top + selectedThickness.Left + selectedThickness.Right) * 0.25; if (me.lastBorderWidth != selectedWidth) { me.lastBorderWidth = selectedWidth; me.Update(); } } }