Xuni User Guide > Xuni Controls > Gauge > Features > Direction |
The Direction
property allows you to change the orientation of the gauge as well as the direction in which the pointer moves. For example, setting the Direction
to Down changes the gauge orientation from horizontal to vertical and the pointer starts from the top of the gauge and move towards the bottom.
The following image shows how the LinearGauge appears after this property has been set.
The following code examples demonstrate how to set this property in C# and XAML. These examples use the sample created in the LinearGauge Quick Start section.
C# |
Copy Code |
---|---|
gauge.Direction = LinearGaugeDirection.Down; |
XAML |
Copy Code |
---|---|
<xuni:XuniLinearGauge Value="35" Min="0" Max="100" Thickness="0.1" WidthRequest="50" HeightRequest="50" Direction="Down" PointerColor="Blue"> <xuni:XuniLinearGauge.Ranges> <xuni:GaugeRange Min="0" Max="40" Color="Red"/> <xuni:GaugeRange Min="40" Max="80" Color="Yellow"/> <xuni:GaugeRange Min="80" Max="100" Color="Green"/> </xuni:XuniLinearGauge.Ranges> </xuni:XuniLinearGauge> |