예제 #1
0
        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;
        }
예제 #2
0
        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;
        }
예제 #3
0
        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();
        }