void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: #line 25 "..\..\..\..\ColorPickerDemo\ColorForm.xaml" ((System.Windows.Controls.TextBlock)(target)).MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.TextBlock_MouseLeftButtonDown); #line default #line hidden return; case 2: #line 26 "..\..\..\..\ColorPickerDemo\ColorForm.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click); #line default #line hidden return; case 3: this.ColorPicker = ((ColorPicker.ColorPicker)(target)); return; } this._contentLoaded = true; }
public override void OnApplyTemplate() { base.OnApplyTemplate(); m_popup = GetTemplateChild("PART_Popup") as UIElement; m_colorPicker = GetTemplateChild("PART_ColorPicker") as ColorPicker; m_toggleButton = GetTemplateChild("PART_ToggleButton") as ToggleButton; if (m_colorPicker != null) m_colorPicker.SelectedColor = SelectedColor; }
void colorSelector_ColorChanged(object sender, ColorPicker.EventArgs<Color> e) { SetValue(SelectedColorProperty, e.Value.WithAlpha(alphaDisplay.Alpha )); if (SelectedColorChanged != null) { SelectedColorChanged(this, new EventArgs<Color>(SelectedColor)); } }
void alphaDisplay_AlphaChanged(object sender, ColorPicker.EventArgs<byte> e) { SetValue(SelectedColorProperty,SelectedColor.WithAlpha(e.Value)); if (SelectedColorChanged != null) { SelectedColorChanged(this, new EventArgs<Color>(SelectedColor)); } }
void Start() { image = GetComponent <Image>(); picker = transform.parent.GetComponent <ColorPicker>(); rectTransform = GetComponent <RectTransform>(); }
void Awake() { myself = this; }
// Use this for initialization void Start() { image = GetComponent <Image>(); picker = GameObject.Find("Panel").GetComponent <ColorPicker>(); }
private static void OnHsvControlSelectedColorChanged(object sender, RoutedPropertyChangedEventArgs <Color> e) { ColorPicker colorPicker = sender as ColorPicker; colorPicker.OnHsvControlSelectedColorChanged(e); }
private static void OnSliderValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e) { ColorPicker colorPicker = sender as ColorPicker; colorPicker.OnSliderValueChanged(e); }