//</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); }
//</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); }
//</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); }