예제 #1
0
        //</SnippetFPMOnPCMax>
        //<SnippetFPMCoerceMax>
        private static object CoerceMaxReading(DependencyObject d, object value)
        {
            FEGauge g   = (FEGauge)d;
            double  max = (double)value;

            if (max < g.MinReading)
            {
                max = g.MinReading;
            }
            return(max);
        }
예제 #2
0
        //</SnippetFPMOnPCMin>
        //<SnippetFPMCoerceMin>
        private static object CoerceMinReading(DependencyObject d, object value)
        {
            FEGauge g   = (FEGauge)d;
            double  min = (double)value;

            if (min > g.MaxReading)
            {
                min = g.MaxReading;
            }
            return(min);
        }
예제 #3
0
        //</SnippetFPMCurrentDefinitionWithWrapper>
        //<SnippetFPMCoerceCurrent>
        private static object CoerceCurrentReading(DependencyObject d, object value)
        {
            FEGauge g       = (FEGauge)d;
            double  current = (double)value;

            if (current < g.MinReading)
            {
                current = g.MinReading;
            }
            if (current > g.MaxReading)
            {
                current = g.MaxReading;
            }
            return(current);
        }