예제 #1
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            HueSlider = GetTemplateChild("HueSlider") as ColorPickerSlider;
            HueSlider.ValueChanged += delegate(object sender, RoutedPropertyChangedEventArgs <double> e) {
                SaveToConfig();
            };

            HueSlider.StartedDragging += delegate() { StartedDragging?.Invoke(); };
            HueSlider.StoppedDragging += delegate() { StoppedDragging?.Invoke(); };

            DoubleCollection ticks = new DoubleCollection();

            // Add a tick at the minimum value, which is a negative value.  This is the
            // tick for white.
            ticks.Add(HueSlider.Minimum);

            // Add a tick for 0-359.  Don't add 360, since that's the same as 0.
            for (int i = 0; i < 360; ++i)
            {
                ticks.Add(i);
            }
            HueSlider.Ticks = ticks;

            OnConfigChange onConfigChange;

            onConfigChange = new OnConfigChange(this, delegate(LoadFromConfigDelegateArgs args) {
                int pad = SelectedPanel < 9? 0:1;
                LoadUIFromConfig(args.controller[pad].config);
            });
        }
예제 #2
0
 protected override void OnThumbDragCompleted(DragCompletedEventArgs e)
 {
     base.OnThumbDragCompleted(e);
     StoppedDragging?.Invoke();
 }