private static void OnHSPropertyAnimated(DependencyObject obj, DependencyPropertyChangedEventArgs args) { CIESelector ctl = (obj as CIESelector); //ctl.Value.x = (args.NewValue as Point?).Value.X; //ctl.Value.y = (args.NewValue as Point?).Value.Y; ctl.InvalidateVisual(); }
public static void OnThumbSizeChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args) { // Force a re-render of the object if the thumb size changes CIESelector ctl = (obj as CIESelector); ctl.UpdateThumbSize(); ctl.InvalidateMeasure(); // Updating the thumbsize changes the dial radius ctl.UpdateSelector(); // Also need to re-calculate the thumb position ctl.InvalidateVisual(); // And then re-paint everything }
public static void OnColorChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args) { // Force a re-render of the object if a visual-related property changes CIESelector ctl = (obj as CIESelector); ctl.InvalidateVisual(); // Force an update of the property binding, because animations don't update the property itself. //ctl.SetValue(args.Property, args.NewValue); if (args.Property == CIESelector.XProperty) { ctl.X = (double)args.NewValue; } if (args.Property == CIESelector.YProperty) { ctl.Y = (double)args.NewValue; } }