示例#1
0
        private static void MyValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            LimitedSlider self = (LimitedSlider)d;
              var h = self.LimitValue;
              if (h == null) return;
              var args = new LimitEventArgs() { Value = e.NewValue };
              h(self, args);

              if (args.Value != e.NewValue) {
            self.SetValue(e.Property, args.Value);
              }
        }
        private void LimitValue3(object sender, LimitEventArgs e)
        {
            var v = (double)e.Value;
              if (v < Value2) e.Value = Value2;

              OnPropertyChanged("Range3Margin");
              OnPropertyChanged("Range4Margin");
        }
        private void LimitValue2(object sender, LimitEventArgs e)
        {
            var v = (double)e.Value;
              if (v > Value3) e.Value = Value3;
              else if (v < Value1) e.Value = Value1;

              OnPropertyChanged("Range2Margin");
              OnPropertyChanged("Range3Margin");
        }