public override void OnApplyTemplate() { base.OnApplyTemplate(); Body = GetTemplateChild(BodyName) as Grid; _slider = GetTemplateChild(SliderName) as SuperSlider; //_slider = GetTemplateChild(SliderName) as SuperSliderUpdate; _selectedColor = GetTemplateChild(SelectedColorName) as Rectangle; if (_slider != null) { _slider.ApplyTemplate(); _slider.ValueChanged += Slider_ValueChanged; if (Color.A == 0 && Color.R == 0 && Color.G == 0 && Color.B == 0) { Color = System.Windows.Media.Color.FromArgb(255, 6, 255, 0); } else { UpdateLayoutBasedOnColor(); } } if (Thumb == null) { Thumb = new ColorSliderThumb(); } SizeChanged += UserControl_SizeChanged; IsEnabledVisualStateUpdate(); }
protected override void OnApplyTemplate() { base.OnApplyTemplate(); Body = GetTemplateChild(BodyName) as Grid; _horizontalSlider = GetTemplateChild(HorizontalSliderName) as SuperSlider; _verticalSlider = GetTemplateChild(VerticalSliderName) as SuperSlider; _horizontalSelectedColor = GetTemplateChild(HorizontalSelectedColorName) as Rectangle; _verticalSelectedColor = GetTemplateChild(VerticalSelectedColorName) as Rectangle; if (_horizontalSlider != null) _horizontalSlider.ApplyTemplate(); if (_verticalSlider != null) _verticalSlider.ApplyTemplate(); if (Color.A == 0 && Color.R == 0 && Color.G == 0 && Color.B == 0) Color = Windows.UI.Color.FromArgb(255, 6, 255, 0); // this should be theme accent brush I think. else UpdateLayoutBasedOnColor(); if (Thumb == null) Thumb = new ColorSliderThumb(); IsEnabledVisualStateUpdate(); }
public override void OnApplyTemplate() #endif { base.OnApplyTemplate(); Body = GetTemplateChild(BodyName) as Grid; Slider = GetTemplateChild(SliderName) as SuperSlider; if (Thumb == null) Thumb = new ColorSliderThumb(); SelectedColor = GetTemplateChild(SelectedColorName) as Rectangle; SizeChanged += UserControl_SizeChanged; if (Slider != null) { Slider.ValueChanged += Slider_ValueChanged; if (Color.A == 0 && Color.R == 0 && Color.G == 0 && Color.B == 0) Color = Color.FromArgb(255, 6, 255, 0); else UpdateLayoutBasedOnColor(); } IsEnabledVisualStateUpdate(); }
public override void OnApplyTemplate() #endif { base.OnApplyTemplate(); Body = GetTemplateChild(BodyName) as Grid; Slider = GetTemplateChild(SliderName) as SuperSlider; if (Thumb == null) { Thumb = new ColorSliderThumb(); } SelectedColor = GetTemplateChild(SelectedColorName) as Rectangle; SizeChanged += UserControl_SizeChanged; if (Slider != null) { Slider.ValueChanged += Slider_ValueChanged; if (Color.A == 0 && Color.R == 0 && Color.G == 0 && Color.B == 0) { Color = Color.FromArgb(255, 6, 255, 0); } else { UpdateLayoutBasedOnColor(); } } IsEnabledVisualStateUpdate(); }
public override void OnApplyTemplate() { base.OnApplyTemplate(); Body = GetTemplateChild(BodyName) as Grid; _slider = GetTemplateChild(SliderName) as SuperSlider; //_slider = GetTemplateChild(SliderName) as SuperSliderUpdate; _selectedColor = GetTemplateChild(SelectedColorName) as Rectangle; if (_slider != null) { _slider.ApplyTemplate(); _slider.ValueChanged += Slider_ValueChanged; if (Color.A == 0 && Color.R == 0 && Color.G == 0 && Color.B == 0) Color = System.Windows.Media.Color.FromArgb(255, 6, 255, 0); else UpdateLayoutBasedOnColor(); } if (Thumb == null) Thumb = new ColorSliderThumb(); SizeChanged += UserControl_SizeChanged; IsEnabledVisualStateUpdate(); }
public override void OnApplyTemplate() #endif { base.OnApplyTemplate(); SampleSelector = GetTemplateChild(SampleSelectorName) as Grid; SelectedHueColor = GetTemplateChild(SelectedHueColorName) as Rectangle; var body = GetTemplateChild(BodyName) as Grid; if (body != null) { _monitor = new MovementMonitor(); _monitor.Movement += _monitor_Movement; _monitor.MonitorControl(body); } ColorSlider = GetTemplateChild(ColorSliderName) as ColorSlider; if (ColorSlider != null) { if (Thumb == null) { Thumb = new ColorSliderThumb(); } ColorSlider.ColorChanged += ColorSlider_ColorChanged; if (SelectedHueColor != null) { #if WINDOWS_STORE || WINDOWS_PHONE_APP var binding = new Windows.UI.Xaml.Data.Binding(); #elif WINDOWS_PHONE var binding = new System.Windows.Data.Binding(); #endif binding.Source = ColorSlider; binding.Path = new PropertyPath("SolidColorBrush"); SelectedHueColor.SetBinding(Shape.FillProperty, binding); } } }
public override void OnApplyTemplate() #endif { base.OnApplyTemplate(); SampleSelector = GetTemplateChild(SampleSelectorName) as Grid; SelectedHueColor = GetTemplateChild(SelectedHueColorName) as Rectangle; var body = GetTemplateChild(BodyName) as Grid; if (body != null) { _monitor = new MovementMonitor(); _monitor.Movement += _monitor_Movement; _monitor.MonitorControl(body); } ColorSlider = GetTemplateChild(ColorSliderName) as ColorSlider; if (ColorSlider != null) { if (Thumb == null) Thumb = new ColorSliderThumb(); ColorSlider.ColorChanged += ColorSlider_ColorChanged; if(SelectedHueColor != null) { #if WINDOWS_STORE || WINDOWS_PHONE_APP var binding = new Windows.UI.Xaml.Data.Binding(); #elif WINDOWS_PHONE var binding = new System.Windows.Data.Binding(); #endif binding.Source = ColorSlider; binding.Path = new PropertyPath("SolidColorBrush"); SelectedHueColor.SetBinding(Shape.FillProperty, binding); } } }
public override void OnApplyTemplate() { base.OnApplyTemplate(); Body = GetTemplateChild(BodyName) as Grid; _horizontalSlider = GetTemplateChild(HorizontalSliderName) as SuperSliderUpdate; _verticalSlider = GetTemplateChild(VerticalSliderName) as SuperSliderUpdate; _horizontalSelectedColor = GetTemplateChild(HorizontalSelectedColorName) as Rectangle; _verticalSelectedColor = GetTemplateChild(VerticalSelectedColorName) as Rectangle; if (_horizontalSlider != null) { _horizontalSlider.ApplyTemplate(); } if (_verticalSlider != null) { _verticalSlider.ApplyTemplate(); } if (Color.A == 0 && Color.R == 0 && Color.G == 0 && Color.B == 0) { Color = System.Windows.Media.Color.FromArgb(255, 6, 255, 0); // this should be theme accent brush I think. } else { UpdateLayoutBasedOnColor(); } if (Thumb == null) { Thumb = new ColorSliderThumb(); } IsEnabledVisualStateUpdate(); }
public override void OnApplyTemplate() { base.OnApplyTemplate(); SampleSelector = GetTemplateChild(SampleSelectorName) as Grid; SelectedHueColor = GetTemplateChild(SelectedHueColorName) as Rectangle; var body = GetTemplateChild(BodyName) as Grid; if (body != null) { _monitor = new MovementMonitor(); _monitor.Movement += _monitor_Movement; _monitor.MonitorControl(body); } ColorSlider = GetTemplateChild(ColorSliderName) as ColorSlider; if (ColorSlider != null) { if (Thumb == null) Thumb = new ColorSliderThumb(); ColorSlider.ColorChanged += ColorSlider_ColorChanged; if(SelectedHueColor != null) { var binding = new System.Windows.Data.Binding { Source = ColorSlider, Path = new PropertyPath("SolidColorBrush"), }; SelectedHueColor.SetBinding(Shape.FillProperty, binding); } } }