Exemplo n.º 1
0
        private static void OnColorChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            ColorSe ColorSe  = (ColorSe)sender;
            Color   oldColor = (Color)e.OldValue;
            Color   newColor = (Color)e.NewValue;

            ColorSe.Red   = newColor.R;
            ColorSe.Green = newColor.G;
            ColorSe.Blue  = newColor.B;

            ColorSe.OnColorChanged(oldColor, newColor);
        }
Exemplo n.º 2
0
        private static void OnColorRGBChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            ColorSe ColorSe = (ColorSe)sender;
            Color   color   = ColorSe.Color;

            if (e.Property == RedProperty)
            {
                color.R = (byte)e.NewValue;
            }
            else if (e.Property == GreenProperty)
            {
                color.G = (byte)e.NewValue;
            }
            else if (e.Property == BlueProperty)
            {
                color.B = (byte)e.NewValue;
            }

            ColorSe.Color = color;
        }
Exemplo n.º 3
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.Cs = ((CustomControls.ColorSe)(target));

            #line 11 "..\..\MainWindow.xaml"
                this.Cs.ColorChanged += new System.Windows.RoutedPropertyChangedEventHandler <System.Windows.Media.Color>(this.Cs_ColorChanged);

            #line default
            #line hidden
                return;

            case 2:
                this.tb = ((System.Windows.Controls.TextBlock)(target));
                return;
            }
            this._contentLoaded = true;
        }