|
<gauge:LinearGaugeAnnotation ScaleValue ="{Binding ScaleValue, Mode=TwoWay}" x:Name="annotation" HorizontalViewAlignment="{Binding ScaleValue,Converter={StaticResource doubleToalignmentConverter}}">
<gauge:LinearGaugeAnnotation.View>
<Label Text="CPU Utilization" WidthRequest="110" FontAttributes = "Bold" TextColor= "Black" FontSize ="15"/>
</gauge:LinearGaugeAnnotation.View>
</gauge:LinearGaugeAnnotation> |
|
public class DoubleToalignmentConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return (int)value == 0 ? ViewAlignment.Start : (int)value == 100 ? ViewAlignment.End : ViewAlignment.Center;
}
..
} |