コード例 #1
0
        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;
        }
コード例 #2
0
        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;
        }