예제 #1
0
 private static void OnSelectedSliderChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
 {
     //throw new NotImplementedException();
     EffectUC uc = (EffectUC)d;
     //if (uc.SelectedSlider != null)
     //    uc.position.Text = uc.SelectedSlider.Pos.ToString();
     //else
     //    uc.position.Text = "";
 }
예제 #2
0
        private static void OnPatternChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            EffectUC uc = (EffectUC)d;

            if (uc.Pattern != null)
            {
                uc.TuneControl();
            }
            uc.colorPanel.SetPanel(uc.UpSliderList[0].SliderType);
        }
예제 #3
0
        private static void OnSelectedScreenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            List <SliderItem> activeSliderList   = null;
            MultiSlider       activeMultiSlider  = null;
            MultiSlider       passiveMultiSlider = null;

            if (d != null)
            {
                EffectUC uc = (EffectUC)d;
                uc.SelectedSlider = null;

                if (uc.SelectedScreen == 0)
                {
                    activeSliderList              = uc.UpSliderList;
                    activeMultiSlider             = uc.upMultiSlider;
                    passiveMultiSlider            = uc.downMultiSlider;
                    uc.upMultiSlider.Visibility   = Visibility.Visible;
                    uc.downMultiSlider.Visibility = Visibility.Hidden;
                }
                else
                {
                    activeSliderList              = uc.DownSliderList;
                    activeMultiSlider             = uc.downMultiSlider;
                    passiveMultiSlider            = uc.upMultiSlider;
                    uc.upMultiSlider.Visibility   = Visibility.Hidden;
                    uc.downMultiSlider.Visibility = Visibility.Visible;
                }

                BindingOperations.ClearBinding(passiveMultiSlider, MultiSlider.SelectedSliderProperty);
                BindingOperations.SetBinding(activeMultiSlider, MultiSlider.SelectedSliderProperty, new Binding("SelectedSlider")
                {
                    Source = uc, Mode = BindingMode.TwoWay
                });

                foreach (SliderItem si in activeSliderList)
                {
                    if (si.IsSelected)
                    {
                        uc.SelectedSlider = si;
                    }
                }

                uc.SetActiveList.Execute(activeSliderList);
                uc.colorPanel.SetPanel(activeSliderList[0].SliderType);

                //if (uc.SelectedScreen == 0)
                //{
                //    BindingOperations.ClearBinding(uc.downMultiSlider, MultiSlider.SelectedSliderProperty);

                //    uc.downMultiSlider.Visibility = Visibility.Hidden;
                //    uc.upMultiSlider.Visibility = Visibility.Visible;
                //    BindingOperations.SetBinding(uc.upMultiSlider, MultiSlider.SelectedSliderProperty, new Binding("SelectedSlider") { Source = uc, Mode = BindingMode.TwoWay });

                //    foreach (SliderItem si in uc.UpSliderList)
                //        if (si.IsSelected)
                //            uc.SelectedSlider = si;

                //    uc.SetActiveList.Execute(uc.UpSliderList);
                //    uc.colorPanel.SetPanel(uc.UpSliderList[0].SliderType);
                //}
                //else
                //{
                //    BindingOperations.ClearBinding(uc.upMultiSlider, MultiSlider.SelectedSliderProperty);
                //    uc.SelectedSlider = null;
                //    uc.upMultiSlider.Visibility = Visibility.Hidden;
                //    uc.downMultiSlider.Visibility = Visibility.Visible;
                //    BindingOperations.SetBinding(uc.downMultiSlider, MultiSlider.SelectedSliderProperty, new Binding("SelectedSlider") { Source = uc, Mode = BindingMode.TwoWay });

                //    foreach (SliderItem si in uc.DownSliderList)
                //        if (si.IsSelected)
                //            uc.SelectedSlider = si;
                //    uc.SetActiveList.Execute(uc.DownSliderList);
                //    uc.colorPanel.SetPanel(uc.DownSliderList[0].SliderType);
                //}
            }
        }