The Value property denotes the value of the gauge. Multiple ranges can be added to a single Gauge and the position of the range is defined by the Min and Max properties of the range. If you set the IsReadOnly property to false, then the user can edit the value by tapping on the gauge.

Note: The C1LinearGauge.Origin property can be used to change the origin of the LinearGauge pointer. By default, the Origin is set to 0.

Complete the following steps to initialize a LinearGauge control in C# or XAML.

In Code

Add a new class (for example QuickStart.cs) to your portable or shared project and include the following references.

To return a C# class: In the class constructor App( ), set a new ContentPage as the MainPage and assign the control to the ContentPage's Content by invoking the method GetLinearGauge( ) defined in the previous procedure, Step 1: Add a LinearGauge Control.

The following code shows the class constructor App() after completing steps above.

In the Solution Explorer, double click AppDelegate.cs inside YourAppName.iOS project, to open it.

Add the following code to the FinishedLaunching( ) method.

C#

Copy Code

C1.Xamarin.Forms.Gauge.Platform.iOS.C1GaugeRenderer.Init();

UWP App:

In the Solution Explorer, expand MainPage.xaml.

Double click MainPage.xaml.cs to open it.

Add the following code to the class constructor.

C#

Copy Code

C1.Xamarin.Forms.Gauge.Platform.UWP.C1GaugeRenderer.Init();

(Optional) In case you compile your UWP application in Release mode, you need to explicitly add the following code to the OnLaunched method in your App.xaml.cs to include the correct assemblies with your application.