private static void ValueProperty_OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { FlatScroll fs = (FlatScroll)d; if ((double)e.NewValue < 0) { fs.SetValue(ValueProperty, (double)0); } else if ((double)e.NewValue > 100) { fs.SetValue(ValueProperty, (double)100); } fs.CalculatePosition(); }
private static void ShowButtonsProperty_OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { FlatScroll fs = (FlatScroll)d; if ((bool)e.NewValue) { fs.UpBtn.Visibility = Visibility.Visible; fs.DownBtn.Visibility = Visibility.Visible; } else { fs.UpBtn.Visibility = Visibility.Hidden; fs.DownBtn.Visibility = Visibility.Hidden; } fs.UpBtn_SizeChanged(fs, null); }
private static void ScrollMarginProperty_OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { FlatScroll fs = (FlatScroll)d; fs.UpBtn_SizeChanged(fs, null); }