void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 2:
                this.css = ((Bio.Controls.ColorSaturationSelector)(target));
                return;

            case 3:

            #line 58 "..\..\ColorPicker.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.OnAddToCustomColors);

            #line default
            #line hidden
                return;

            case 4:
                this.knownColorsLb = ((System.Windows.Controls.ListBox)(target));
                return;

            case 5:
                this.customColorsLb = ((System.Windows.Controls.ListBox)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemple #2
0
        private static void OnColorChanged(DependencyObject dpo, DependencyPropertyChangedEventArgs e)
        {
            ColorSaturationSelector css = (ColorSaturationSelector)dpo;

            if (!css._updatingColor)
            {
                css._updatingColor = true;
                double h, s, b;
                css.Color.ToHsb(out h, out s, out b);
                css.Hue            = h;
                css.Saturation     = s;
                css.Brightness     = b;
                css._updatingColor = false;
            }

            css.ColorBrush = new SolidColorBrush(css.Color);
            css.CalculateMarkerPosition();

            var cce = css.ColorChanged;

            if (cce != null)
            {
                cce.Invoke(css, EventArgs.Empty);
            }
        }