private static void OnPointsPerTickPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { ScaleBar scalebar = (ScaleBar)sender; scalebar.AdjustedPointsPerTick = scalebar.PointsPerTick * scalebar.AdjustedUnitsPerTick / scalebar.UnitsPerTick; scalebar.AdjustedPointsPerUnit = scalebar.AdjustedPointsPerTick / scalebar.AdjustedUnitsPerTick; scalebar.PointsPerUnit = scalebar.PointsPerTick / scalebar.UnitsPerTick; }
private static void OnUnitsPerTickPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { ScaleBar scalebar = (ScaleBar)sender; scalebar.AdjustedUnitsPerTick = AdjustUnitInterval((double)e.NewValue); scalebar.AdjustedPointsPerTick = scalebar.PointsPerTick * scalebar.AdjustedUnitsPerTick / scalebar.UnitsPerTick; scalebar.AdjustedPointsPerUnit = scalebar.AdjustedPointsPerTick / scalebar.AdjustedUnitsPerTick; scalebar.PointsPerUnit = scalebar.PointsPerTick / scalebar.UnitsPerTick; }