private static void CoordPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs args) { DDDependencyPoint sender = (DDDependencyPoint)d; if (sender.InternalUpdate) { return; } sender.InternalUpdate = true; sender.Point = new Point(sender.X, sender.Y); sender.InternalUpdate = false; }
private static void PointPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs args) { DDDependencyPoint sender = (DDDependencyPoint)d; Point newValue = (Point)args.NewValue; if (sender.InternalUpdate) { return; } sender.InternalUpdate = true; sender.X = newValue.X; sender.Y = newValue.Y; sender.InternalUpdate = false; }
public DDBrushPicker() { InitializeComponent(); xamlSolidColorCombo.ItemsSource = DefaultColors; xamlSolidColorCombo.Text = ""; LinearStart = new DDDependencyPoint(); LinearEnd = new DDDependencyPoint(); RadialOrigin = new DDDependencyPoint(); RadialCenter = new DDDependencyPoint(); SolidColorBrush = new SolidColorBrush(Colors.Transparent); LinearGradientBrush = new LinearGradientBrush(Colors.White, Colors.Black, 0); RadialGradientBrush = new RadialGradientBrush(Colors.White, Colors.Black); //BindBrushes(); }