Ejemplo n.º 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);
            });
        }
Ejemplo n.º 2
0
 void HandleTouchStart()
 {
     if (itemIndex < ItemsSource.Count)
     {
         StartedDragging?.Invoke(this, new DraggingEventArgs(ItemsSource[itemIndex]));
     }
 }
Ejemplo n.º 3
0
        private void HandleTouchStart()
        {
            if (_itemIndex >= ItemsSource.Count)
            {
                return;
            }

            if (_cardDistance != 0)
            {
                return;
            }

            _lastX = 0;

            _isDragging = true;

            StartedDragging?.Invoke(this, new DraggingEventArgs(ItemsSource[_itemIndex], 0));
        }
Ejemplo n.º 4
0
 // How are there no events for this?
 protected override void OnThumbDragStarted(DragStartedEventArgs e)
 {
     base.OnThumbDragStarted(e);
     StartedDragging?.Invoke();
 }