private static void SelectedColourChangedCallBack(DependencyObject property, DependencyPropertyChangedEventArgs args)
        {
            ColourSlider colourSlider = (ColourSlider)property;
            Color        colour       = (Color)args.NewValue;

            colourSlider.SetColour(colour);
        }
示例#2
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
 {
     switch (connectionId)
     {
     case 1:
         this.picker = ((ColourSliderLibrary.ColourSlider)(target));
         return;
     }
     this._contentLoaded = true;
 }
        public void CreateSliders()
        {
            sliders = new ColourSlider[20];
            mLabels = new Label[20];
                        
            for (int i = 0; i < 20; i++)
            {
                sliders[i] = new ColourSlider();
                sliders[i].Maximum = 1;
                sliders[i].Minimum = -1;
                sliders[i].Width = 80;                
                sliders[i].RenderTransformOrigin = new Point(0.5, 0.5);
                sliders[i].Value = 0;
                            
                Thickness m = sliders[i].Margin;
                m.Left = -850 + (90 * i);
                sliders[i].Margin = m;
                RotateTransform rotateTransform1 = new RotateTransform(-90, 0, 0);
                sliders[i].RenderTransform = rotateTransform1;              
                sliders[i].Visibility = Visibility.Visible;

                mPlaceholder.Children.Add(sliders[i]);

                mLabels[i] = new Label();
                mLabels[i].FontSize = 8;
                mLabels[i].Foreground = Brushes.White;
                mLabels[i].Content = "00:00:00";
                Thickness ma = mLabels[i].Margin;
                ma.Left = 12 + (45 * i);
                ma.Top = 85;
                mLabels[i].Margin = ma;

                mPlaceholder.Children.Add(mLabels[i]);
            }

            State = CHANGESTATE.READY;
            Clear();

        }