This commit is contained in:
Rene Schwarz
2021-08-06 12:35:46 +02:00
parent 2240d30570
commit 4828f95ebb
59 changed files with 476 additions and 829 deletions

View File

@@ -12,83 +12,13 @@
<UserControl.Resources>
<root:ValueToAngleConverter x:Key="valueToAngle"/>
</UserControl.Resources>
<!--Circular Prograss bar-->
<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=ValueRead
}"
Fill="{Binding
ElementName=_this,
Path=ReadIndicatorBrush
}"
Stretch="None"
StartAngle="0"
/>
<Ellipse
x:Name="Seperator"
Fill="Transparent"
Margin="7"
Stroke="{Binding
ElementName=_this,
Path=ProgressBorderBrush
}"
Panel.ZIndex="1"
/>
<Ellipse
x:Name="Seperator2"
Fill="Transparent"
Margin="8"
Stroke="{Binding
ElementName=_this,
Path=ProgressBorderBrush
}"
Panel.ZIndex="1"
/>
<ed:Arc
Margin="8"
ArcThickness="8"
ArcThicknessUnit="Pixel"
EndAngle="{Binding
Converter={StaticResource valueToAngle},
ElementName=_this,
Path=ValueWrite
}"
Fill="{Binding
ElementName=_this,
Path=WriteIndicatorBrush
}"
Stretch="None"
StartAngle="0"
/>
<Ellipse
x:Name="Border"
Fill="{Binding
ElementName=_this,
Path=ProgressBorderBrush
}"
Margin="16"
Stroke="{Binding
ElementName=_this,
Path=ProgressBorderBrush
}"
/>
<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=ValueRead}" Fill="{Binding ElementName=_this, Path=ReadIndicatorBrush}" Stretch="None" StartAngle="0"/>
<Ellipse x:Name="Seperator" Fill="Transparent" Margin="7" Stroke="{Binding ElementName=_this, Path=ProgressBorderBrush}" Panel.ZIndex="1"/>
<Ellipse x:Name="Seperator2" Fill="Transparent" Margin="8" Stroke="{Binding ElementName=_this, Path=ProgressBorderBrush}" Panel.ZIndex="1"/>
<ed:Arc Margin="8" ArcThickness="8" ArcThicknessUnit="Pixel" EndAngle="{Binding Converter={StaticResource valueToAngle}, ElementName=_this, Path=ValueWrite}" Fill="{Binding ElementName=_this, Path=WriteIndicatorBrush}" Stretch="None" StartAngle="0"/>
<Ellipse x:Name="Border" Fill="{Binding ElementName=_this, Path=ProgressBorderBrush}" Margin="16" Stroke="{Binding ElementName=_this, Path=ProgressBorderBrush}"/>
</Grid>
</UserControl>

View File

@@ -13,37 +13,47 @@ using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Server_Dashboard.Controls.DoubleRoundProgressBar {
/// <summary>
/// DependencyProperties
/// </summary>
public partial class DoubleRoundProgressBar : UserControl {
//Property for the ReadIndicatorBrush
public static DependencyProperty ReadIndicatorBrushProperty = DependencyProperty.Register("ReadIndicatorBrush", typeof(Brush), typeof(DoubleRoundProgressBar));
public Brush ReadIndicatorBrush {
get { return (Brush)GetValue(ReadIndicatorBrushProperty); }
set { SetValue(ReadIndicatorBrushProperty, value); }
}
//Property for the WriteIndicatorBrush
public static DependencyProperty WriteIndicatorBrushProperty = DependencyProperty.Register("WriteIndicatorBrush", typeof(Brush), typeof(DoubleRoundProgressBar));
public Brush WriteIndicatorBrush {
get { return (Brush)GetValue(WriteIndicatorBrushProperty); }
set { SetValue(WriteIndicatorBrushProperty, value); }
}
//Property for the BackgroundBrush
public static DependencyProperty BackgroundBrushProperty = DependencyProperty.Register("BackgroundBrush", typeof(Brush), typeof(DoubleRoundProgressBar));
public Brush BackgroundBrush {
get { return (Brush)GetValue(BackgroundBrushProperty); }
set { SetValue(BackgroundBrushProperty, value); }
}
//Property for the ProgressBorderBrush
public static DependencyProperty ProgressBorderBrushProperty = DependencyProperty.Register("ProgressBorderBrush", typeof(Brush), typeof(DoubleRoundProgressBar));
public Brush ProgressBorderBrush {
get { return (Brush)GetValue(ProgressBorderBrushProperty); }
set { SetValue(ProgressBorderBrushProperty, value); }
}
//Property for the Value Write
public static DependencyProperty ValueWriteProperty = DependencyProperty.Register("ValueWrite", typeof(int), typeof(DoubleRoundProgressBar));
public int ValueWrite {
get { return (int)GetValue(ValueWriteProperty); }
set { SetValue(ValueWriteProperty, value); }
}
//Property for the Value Read
public static DependencyProperty ValueReadProperty = DependencyProperty.Register("ValueRead", typeof(int), typeof(DoubleRoundProgressBar));
public int ValueRead {
get { return (int)GetValue(ValueReadProperty); }