ComponentOne Gauge for UWP
Gauges for UWP Task-Based Help / Setting the Minimum and Maximum Values
In This Topic
    Setting the Minimum and Maximum Values
    In This Topic

    You can use the C1Gauge.Minimum and C1Gauge.Maximum properties to set a numeric range that the gauge would be limited to. You can customize the C1Gauge.Minimum and C1Gauge.Maximum values at design time, in XAML, and in code. Although this topic sets the C1Gauge.Minimum and C1Gauge.Maximum properties of the C1LinearGauge control, the same steps can be used to customize the C1Gauge.Minimum and C1Gauge.Maximum of other controls.

    When setting the C1Gauge.Minimum and C1Gauge.Maximum properties, the C1Gauge.Minimum should be smaller than the C1Gauge.Maximum. Also be sure to set the C1Gauge.Value property to a number within the C1Gauge.Minimum and C1Gauge.Maximum range (here the default is 0, which falls within the range set below).

     

    At Design Time

    To set the C1Gauge.Minimum and C1Gauge.Maximum for the C1LinearGauge at run time, complete the following steps:

    1. Click the C1LinearGauge control once to select it.

    2. Navigate to the Properties window, and enter a number, for example 50, next to the C1Gauge.Maximum property.

    3. In the Properties window, enter a number, for example -50, next to the C1Gauge.Minimum property.

    This will set C1Gauge.Minimum and C1Gauge.Maximum values.

    In XAML

    To set the C1LinearGauge control's C1Gauge.Minimum and C1Gauge.Maximum in XAML add Maximum="50" Minimum="-50" to the <Gauge:C1LinearGauge> tag so that it appears similar to the following:

    Markup
    Copy Code
    <Gauge:C1LinearGauge Height="89" Margin="47,57,33,43" Name="C1LinearGauge1" Width="287" Maximum="50" Minimum="-50">
    

    In Code

    To set the C1LinearGauge control's C1Gauge.Minimum and C1Gauge.Maximum add the following code to your project:

    Visual Basic
    Copy Code
    C1LinearGauge1.Minimum = -50
    C1LinearGauge1.Maximum = 50
    

    C#
    Copy Code
    C1LinearGauge1.Minimum = -50;
    C1LinearGauge1.Maximum = 50;
    

    Run your project and observe:

    The gauge will be limited to the selected range at run time:

    See Also