Files
Server-Dashboard/Server Dashboard/Controls/HalfRoundProgressBar/HalfRoundProgressBar.xaml
2021-08-09 00:26:03 +02:00

19 lines
1.4 KiB
XML

<UserControl x:Class="Server_Dashboard.Controls.HalfRoundProgressBar.HalfRoundProgressBar"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Server_Dashboard.Controls.HalfRoundProgressBar"
xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing"
xmlns:root="clr-namespace:Server_Dashboard"
mc:Ignorable="d" x:Name="_this" d:DesignHeight="50" d:DesignWidth="50">
<UserControl.Resources>
<root:ValueToAngleConverter x:Key="valueToAngle" />
</UserControl.Resources>
<!--Progress bar but just half round-->
<Grid>
<Ellipse x:Name="Background" Fill="{Binding ElementName=_this, Path=BackgroundBrush}" Margin="0" Stroke="{Binding ElementName=_this, Path=BackgroundBrush}" />
<ed:Arc ArcThickness="8" ArcThicknessUnit="Pixel" EndAngle="{Binding Converter={StaticResource valueToAngle}, ElementName=_this, Path=Value}" Fill="{Binding ElementName=_this, Path=IndicatorBrush}" Stretch="None" StartAngle="0" />
<Ellipse x:Name="Border" Fill="{Binding ElementName=_this, Path=ProgressBorderBrush}" Margin="8" Stroke="{Binding ElementName=_this, Path=ProgressBorderBrush}" />
</Grid>
</UserControl>