Exemple #1
0
        //private static void TickStepPropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        //{
        //    //- update the ticks and labels
        //    Scale scale = o as Scale;
        //    if (scale != null)
        //    {
        //        if (scale.MinorTickStep == 0) scale.MinorTickStep = 1;
        //        if (scale.MajorTickStep == 0) scale.MajorTickStep = 1;
        //        scale.RefreshLabels();
        //        scale.RefreshTicks();
        //    }
        //}

        private static void TickTemplatesChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            //- update the ticks and labels
            Scale scale = o as Scale;

            if (scale != null)
            {
                scale.RefreshLabels();
                scale.RefreshTicks();
                scale.RefreshIndicators();
            }
        }
Exemple #2
0
        private static void MaximumPropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            Scale scale = o as Scale;

            if (scale != null)
            {
                scale.RefreshLabels();
                scale.RefreshTicks();
                scale.RefreshRanges();
                scale.RefreshIndicators();
            }
        }
Exemple #3
0
        private static void RangeRelatedPropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            // Update the ranges
            // Update the ticks and labels
            // Update the indicators
            Scale scale = o as Scale;

            if (scale != null)
            {
                scale.RefreshRanges();
                scale.RefreshLabels();
                scale.RefreshTicks();
                scale.RefreshIndicators();
            }
        }
Exemple #4
0
        private static void RangesPropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            // Update the ranges
            // Update the ticks and labels
            Scale scale = o as Scale;

            if (scale != null)
            {
                if (e.OldValue != null)
                {
                    ((ObservableCollection <GaugeRange>)e.OldValue).CollectionChanged -= scale.Ranges_CollectionChanged;
                }

                if (e.NewValue != null)
                {
                    ObservableCollection <GaugeRange> col = e.NewValue as ObservableCollection <GaugeRange>;
                    col.CollectionChanged += scale.Ranges_CollectionChanged;
                    scale.RefreshRanges();
                    scale.RefreshTicks();
                    scale.RefreshLabels();
                }
            }
        }