protected override void OnApplyTemplate()
#endif
        {
            base.OnApplyTemplate();

            if (Slider != null)
            {
                Slider.ValueChanged -= slider_ValueChanged;
                Slider.SetBinding(SeekableSlider.ActualValueProperty, null);
            }

            Slider = GetTemplateChild("Slider") as SeekableSlider;
            
            if (Slider != null)
            {
                Slider.ValueChanged += slider_ValueChanged;
                Slider.SetBinding(SeekableSlider.ActualValueProperty, new Binding() { Path = new PropertyPath("Volume"), Source = ViewModel });
            }
        }
示例#2
0
        protected override void OnApplyTemplate()
#endif
        {
            base.OnApplyTemplate();

            if (Slider != null)
            {
                Slider.ValueChanged -= slider_ValueChanged;
                Slider.SetBinding(SeekableSlider.ActualValueProperty, null);
            }

            Slider = GetTemplateChild("Slider") as SeekableSlider;

            if (Slider != null)
            {
                Slider.ValueChanged += slider_ValueChanged;
                Slider.SetBinding(SeekableSlider.ActualValueProperty, new Binding()
                {
                    Path = new PropertyPath("Volume"), Source = ViewModel
                });
            }
        }