public override void OnApplyTemplate()
        {
			base.OnApplyTemplate();

			IsEnabledChanged += SuperSlider_IsEnabledChanged;
			SizeChanged += SuperSliderUpdate_SizeChanged;

			_horizontalTrack = GetTemplateChild(HorizontalTrackName) as FrameworkElement;
			_verticalTrack = GetTemplateChild(VerticalTrackName) as FrameworkElement;

            var body = GetTemplateChild(BodyName) as Grid;

            if (body != null)
            {
                _monitor = new MovementMonitor();
                _monitor.Movement += _monitor_Movement;
                _monitor.MonitorControl(body);
            }

			AdjustAndUpdateLayout();
			UpdateThumb();
			IsEnabledVisualStateUpdate();

			_isLayoutInit = true;
			
			UpdateValueAndUserInterface(Value, Value);
        }
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            IsEnabledChanged += SuperSlider_IsEnabledChanged;
            SizeChanged      += SuperSliderUpdate_SizeChanged;

            _horizontalTrack = GetTemplateChild(HorizontalTrackName) as FrameworkElement;
            _verticalTrack   = GetTemplateChild(VerticalTrackName) as FrameworkElement;

            var body = GetTemplateChild(BodyName) as Grid;

            if (body != null)
            {
                _monitor           = new MovementMonitor();
                _monitor.Movement += _monitor_Movement;
                _monitor.MonitorControl(body);
            }

            AdjustAndUpdateLayout();
            UpdateThumb();
            IsEnabledVisualStateUpdate();

            _isLayoutInit = true;

            UpdateValueAndUserInterface(Value, Value);
        }
		private void ApplyPlatformFeatures()
		{
			var body = GetTemplateChild(HorizontalTemplateName) as Grid;

			if (body != null)
			{
				_monitor = new MovementMonitor();
				_monitor.Movement += _monitor_Movement;
				_monitor.MonitorControl(body);
			}
		}
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            BackgroundRectangle = GetTemplateChild(BackgroundRectangleName) as Rectangle;
            ProgressRectangle   = GetTemplateChild(ProgressRectangleName) as Rectangle;
            var body = GetTemplateChild(BodyName) as Grid;

            if (body != null)
            {
                _monitor           = new MovementMonitor();
                _monitor.Movement += _monitor_Movement;
                _monitor.MonitorControl(body);
            }

            // stuff isn't set enough but if this isn't done, there will an initial flash
            AdjustLayout();
        }
		public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            BackgroundRectangle = GetTemplateChild(BackgroundRectangleName) as Rectangle;
            ProgressRectangle = GetTemplateChild(ProgressRectangleName) as Rectangle;
            var body = GetTemplateChild(BodyName) as Grid;

            if (body != null)
            {
                _monitor = new MovementMonitor();
                _monitor.Movement += _monitor_Movement;
                _monitor.MonitorControl(body);
            }

            // stuff isn't set enough but if this isn't done, there will an initial flash
            AdjustLayout();
        }
        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);
                }
            }
        }
Beispiel #8
0
        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);
                }
            }
        }