Issue #5
This commit is contained in:
@@ -6,19 +6,12 @@
|
||||
xmlns:local="clr-namespace:Server_Dashboard.Views.DashboardPages.ModuleCRUD"
|
||||
xmlns:root="clr-namespace:Server_Dashboard" xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||
d:DataContext="{d:DesignInstance Type=root:DashboardModuleViewModel}"
|
||||
mc:Ignorable="d"
|
||||
ResizeMode="NoResize"
|
||||
Height="700"
|
||||
Width="500"
|
||||
d:WindowStyle="None"
|
||||
>
|
||||
mc:Ignorable="d" ResizeMode="NoResize" Height="700" Width="500" d:WindowStyle="None">
|
||||
<WindowChrome.WindowChrome>
|
||||
<WindowChrome CaptionHeight="0" ResizeBorderThickness="0"/>
|
||||
</WindowChrome.WindowChrome>
|
||||
<Border
|
||||
Width="500"
|
||||
Height="700"
|
||||
>
|
||||
<!--Create new Server Form-->
|
||||
<Border Width="500" Height="700">
|
||||
<Border.Background>
|
||||
<SolidColorBrush Color="#2D2D2D" Opacity="1"/>
|
||||
</Border.Background>
|
||||
@@ -27,10 +20,8 @@
|
||||
<RowDefinition Height="30"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid
|
||||
Background="{StaticResource BackgroundSurface_04dp}"
|
||||
Grid.Row="0"
|
||||
>
|
||||
<!--Title Bar-->
|
||||
<Grid Background="{StaticResource BackgroundSurface_04dp}" Grid.Row="0">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="MouseDown">
|
||||
<i:CallMethodAction MethodName="DragMove" TargetObject="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"/>
|
||||
@@ -40,19 +31,8 @@
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="40"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
Text="Create a new Server"
|
||||
Margin="5 0 0 0"
|
||||
Foreground="{StaticResource DeepPurple_A100}"
|
||||
VerticalAlignment="Center"
|
||||
/>
|
||||
<Button
|
||||
Style="{StaticResource CloseButton}"
|
||||
Grid.Column="2"
|
||||
Content="✕"
|
||||
Cursor="Hand"
|
||||
>
|
||||
<TextBlock Grid.Column="0" Text="Create a new Server" Margin="5 0 0 0" Foreground="{StaticResource DeepPurple_A100}" VerticalAlignment="Center"/>
|
||||
<Button Style="{StaticResource CloseButton}" Grid.Column="2" Content="✕" Cursor="Hand">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<i:CallMethodAction MethodName="Close" TargetObject="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"/>
|
||||
@@ -60,11 +40,7 @@
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
</Grid>
|
||||
<Grid
|
||||
Background="{StaticResource BackgroundSurface_04dp}"
|
||||
Grid.Row="1"
|
||||
Margin="20"
|
||||
>
|
||||
<Grid Background="{StaticResource BackgroundSurface_04dp}" Grid.Row="1" Margin="20">
|
||||
<Grid.Effect>
|
||||
<DropShadowEffect Direction="0" BlurRadius="5" ShadowDepth="0"/>
|
||||
</Grid.Effect>
|
||||
@@ -76,192 +52,98 @@
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<!--Server Name-->
|
||||
<StackPanel VerticalAlignment="Center" Grid.Row="0" Margin="20 0 20 0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Text="Server Name"
|
||||
FontSize="24"
|
||||
Margin="0 0 0 5"
|
||||
>
|
||||
<TextBlock Text="Server Name" FontSize="24" Margin="0 0 0 5">
|
||||
<TextBlock.Foreground>
|
||||
<SolidColorBrush Color="White" Opacity="0.87"/>
|
||||
</TextBlock.Foreground>
|
||||
</TextBlock>
|
||||
<TextBlock
|
||||
Text="*"
|
||||
Foreground="{StaticResource ErrorRed}"
|
||||
FontSize="20"
|
||||
/>
|
||||
<TextBlock Text="*" Foreground="{StaticResource ErrorRed}" FontSize="20"/>
|
||||
</StackPanel>
|
||||
<Grid>
|
||||
<Grid.Effect>
|
||||
<DropShadowEffect Direction="0" BlurRadius="5" ShadowDepth="0"/>
|
||||
</Grid.Effect>
|
||||
<TextBox
|
||||
Text="{Binding ServerName}"
|
||||
Grid.Column="1"
|
||||
Height="40"
|
||||
FontSize="20"
|
||||
x:Name="ServerName"
|
||||
/>
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Left"
|
||||
Text="My Awesome Server"
|
||||
FontSize="20"
|
||||
Visibility="{Binding ElementName=ServerName, Path=Text.IsEmpty, Converter={StaticResource UserNameVisibillity}}"
|
||||
Grid.Column="1"
|
||||
IsHitTestVisible="False"
|
||||
Margin="5 0 0 0"
|
||||
>
|
||||
<TextBox Text="{Binding ServerName}" Grid.Column="1" Height="40" FontSize="20" x:Name="ServerName"/>
|
||||
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="My Awesome Server" FontSize="20" Visibility="{Binding ElementName=ServerName, Path=Text.IsEmpty, Converter={StaticResource UserNameVisibillity}}" Grid.Column="1" IsHitTestVisible="False" Margin="5 0 0 0">
|
||||
<TextBlock.Foreground>
|
||||
<SolidColorBrush Color="White" Opacity="0.12"/>
|
||||
</TextBlock.Foreground>
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
<!--Password-->
|
||||
<StackPanel VerticalAlignment="Center" Grid.Row="1" Margin="20 0 20 0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Text="Password"
|
||||
FontSize="24"
|
||||
Margin="0 0 0 5"
|
||||
>
|
||||
<TextBlock Text="Password" FontSize="24" Margin="0 0 0 5">
|
||||
<TextBlock.Foreground>
|
||||
<SolidColorBrush Color="White" Opacity="0.87"/>
|
||||
</TextBlock.Foreground>
|
||||
</TextBlock>
|
||||
<TextBlock
|
||||
Text="*"
|
||||
Foreground="{StaticResource ErrorRed}"
|
||||
FontSize="20"
|
||||
/>
|
||||
<TextBlock Text="*" Foreground="{StaticResource ErrorRed}" FontSize="20"/>
|
||||
</StackPanel>
|
||||
<Grid>
|
||||
<Grid.Effect>
|
||||
<DropShadowEffect Direction="0" BlurRadius="5" ShadowDepth="0"/>
|
||||
</Grid.Effect>
|
||||
<PasswordBox
|
||||
Width="420"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Left"
|
||||
root:MonitorPasswordProperty.Value="True"
|
||||
Grid.Column="1"
|
||||
FontSize="20"
|
||||
x:Name="Password"
|
||||
Height="40"
|
||||
>
|
||||
<PasswordBox Width="420" VerticalAlignment="Center" HorizontalAlignment="Left" root:MonitorPasswordProperty.Value="True" Grid.Column="1" FontSize="20" x:Name="Password" Height="40">
|
||||
</PasswordBox>
|
||||
<TextBlock
|
||||
Visibility="{Binding ElementName=Password, Path=(root:HasTextProperty.Value), Converter={StaticResource UserNameVisibillity}}" x:Name="PasswordHint"
|
||||
Text="********"
|
||||
Grid.Column="1"
|
||||
IsHitTestVisible="False"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Left"
|
||||
Margin="5 0 0 0"
|
||||
FontSize="20"
|
||||
>
|
||||
<TextBlock Visibility="{Binding ElementName=Password, Path=(root:HasTextProperty.Value), Converter={StaticResource UserNameVisibillity}}" x:Name="PasswordHint" Text="********" Grid.Column="1" IsHitTestVisible="False" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5 0 0 0" FontSize="20">
|
||||
<TextBlock.Foreground>
|
||||
<SolidColorBrush Color="White" Opacity="0.12"/>
|
||||
</TextBlock.Foreground>
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
<!--Username-->
|
||||
<StackPanel VerticalAlignment="Center" Grid.Row="2" Margin="20 0 20 0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Text="Username"
|
||||
FontSize="24"
|
||||
Margin="0 0 0 5"
|
||||
>
|
||||
<TextBlock Text="Username" FontSize="24" Margin="0 0 0 5">
|
||||
<TextBlock.Foreground>
|
||||
<SolidColorBrush Color="White" Opacity="0.87"/>
|
||||
</TextBlock.Foreground>
|
||||
</TextBlock>
|
||||
<TextBlock
|
||||
Text="*"
|
||||
Foreground="{StaticResource ErrorRed}"
|
||||
FontSize="16"
|
||||
/>
|
||||
<TextBlock Text="*" Foreground="{StaticResource ErrorRed}" FontSize="16"/>
|
||||
</StackPanel>
|
||||
<Grid>
|
||||
<Grid.Effect>
|
||||
<DropShadowEffect Direction="0" BlurRadius="5" ShadowDepth="0"/>
|
||||
</Grid.Effect>
|
||||
<TextBox
|
||||
Text="{Binding Username}"
|
||||
Grid.Column="1"
|
||||
Height="40"
|
||||
FontSize="20"
|
||||
x:Name="UserName"
|
||||
/>
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Left"
|
||||
Text="Name"
|
||||
FontSize="20"
|
||||
Visibility="{Binding ElementName=UserName, Path=Text.IsEmpty, Converter={StaticResource UserNameVisibillity}}"
|
||||
Grid.Column="1"
|
||||
IsHitTestVisible="False"
|
||||
Margin="5 0 0 0"
|
||||
>
|
||||
<TextBox Text="{Binding Username}" Grid.Column="1" Height="40" FontSize="20" x:Name="UserName"/>
|
||||
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="Name" FontSize="20" Visibility="{Binding ElementName=UserName, Path=Text.IsEmpty, Converter={StaticResource UserNameVisibillity}}" Grid.Column="1" IsHitTestVisible="False" Margin="5 0 0 0">
|
||||
<TextBlock.Foreground>
|
||||
<SolidColorBrush Color="White" Opacity="0.12"/>
|
||||
</TextBlock.Foreground>
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
<!--IP Adress-->
|
||||
<StackPanel VerticalAlignment="Center" Grid.Row="3" Margin="20 0 20 0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Text="IP Adress"
|
||||
FontSize="24"
|
||||
Margin="0 0 0 5"
|
||||
>
|
||||
<TextBlock Text="IP Adress" FontSize="24" Margin="0 0 0 5">
|
||||
<TextBlock.Foreground>
|
||||
<SolidColorBrush Color="White" Opacity="0.87"/>
|
||||
</TextBlock.Foreground>
|
||||
</TextBlock>
|
||||
<TextBlock
|
||||
Text="*"
|
||||
Foreground="{StaticResource ErrorRed}"
|
||||
FontSize="16"
|
||||
/>
|
||||
<TextBlock Text="*" Foreground="{StaticResource ErrorRed}" FontSize="16"/>
|
||||
</StackPanel>
|
||||
<Grid>
|
||||
<Grid.Effect>
|
||||
<DropShadowEffect Direction="0" BlurRadius="5" ShadowDepth="0"/>
|
||||
</Grid.Effect>
|
||||
<TextBox
|
||||
Text="{Binding IPAdress}"
|
||||
Grid.Column="1"
|
||||
Height="40"
|
||||
FontSize="20"
|
||||
x:Name="IPAdress"
|
||||
/>
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Left"
|
||||
Text="sample.ssh.com"
|
||||
FontSize="20"
|
||||
Visibility="{Binding ElementName=IPAdress, Path=Text.IsEmpty, Converter={StaticResource UserNameVisibillity}}"
|
||||
Grid.Column="1"
|
||||
IsHitTestVisible="False"
|
||||
Margin="5 0 0 0"
|
||||
>
|
||||
<TextBox Text="{Binding IPAdress}" Grid.Column="1" Height="40" FontSize="20" x:Name="IPAdress"/>
|
||||
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="sample.ssh.com" FontSize="20" Visibility="{Binding ElementName=IPAdress, Path=Text.IsEmpty, Converter={StaticResource UserNameVisibillity}}" Grid.Column="1" IsHitTestVisible="False" Margin="5 0 0 0">
|
||||
<TextBlock.Foreground>
|
||||
<SolidColorBrush Color="White" Opacity="0.12"/>
|
||||
</TextBlock.Foreground>
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
<!--Port-->
|
||||
<StackPanel VerticalAlignment="Center" Grid.Row="4" Margin="20 0 20 0">
|
||||
<TextBlock
|
||||
Text="Port"
|
||||
FontSize="24"
|
||||
Margin="0 0 0 5"
|
||||
>
|
||||
<TextBlock Text="Port" FontSize="24" Margin="0 0 0 5">
|
||||
<TextBlock.Foreground>
|
||||
<SolidColorBrush Color="White" Opacity="0.87"/>
|
||||
</TextBlock.Foreground>
|
||||
@@ -270,38 +152,16 @@
|
||||
<Grid.Effect>
|
||||
<DropShadowEffect Direction="0" BlurRadius="5" ShadowDepth="0"/>
|
||||
</Grid.Effect>
|
||||
<TextBox
|
||||
Text="{Binding Port}"
|
||||
Grid.Column="1"
|
||||
Height="40"
|
||||
FontSize="20"
|
||||
x:Name="Port"
|
||||
/>
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Left"
|
||||
Text="22"
|
||||
FontSize="20"
|
||||
Visibility="{Binding ElementName=Port, Path=Text.IsEmpty, Converter={StaticResource UserNameVisibillity}}"
|
||||
Grid.Column="1"
|
||||
IsHitTestVisible="False"
|
||||
Margin="5 0 0 0"
|
||||
>
|
||||
<TextBox Text="{Binding Port}" Grid.Column="1" Height="40" FontSize="20" x:Name="Port"/>
|
||||
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="22" FontSize="20" Visibility="{Binding ElementName=Port, Path=Text.IsEmpty, Converter={StaticResource UserNameVisibillity}}" Grid.Column="1" IsHitTestVisible="False" Margin="5 0 0 0">
|
||||
<TextBlock.Foreground>
|
||||
<SolidColorBrush Color="White" Opacity="0.12"/>
|
||||
</TextBlock.Foreground>
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
<Button
|
||||
Height="60"
|
||||
Width="350"
|
||||
Command="{Binding CreateModuleCommand}"
|
||||
CommandParameter="{Binding ElementName=CREATE_MODULE}"
|
||||
Grid.Row="5"
|
||||
Content="CREATE MODULE"
|
||||
Grid.ColumnSpan="2"
|
||||
/>
|
||||
<!--Create Module button-->
|
||||
<Button Height="60" Width="350" Command="{Binding CreateModuleCommand}" CommandParameter="{Binding ElementName=CREATE_MODULE}" Grid.Row="5" Content="CREATE MODULE" Grid.ColumnSpan="2"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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); }
|
||||
|
||||
@@ -6,52 +6,14 @@
|
||||
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">
|
||||
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
|
||||
}"
|
||||
|
||||
/>
|
||||
<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>
|
||||
|
||||
@@ -13,26 +13,33 @@ using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace Server_Dashboard.Controls.HalfRoundProgressBar {
|
||||
/// <summary>
|
||||
/// Dependency Properties
|
||||
/// </summary>
|
||||
public partial class HalfRoundProgressBar : UserControl {
|
||||
|
||||
|
||||
//Indicator Brush Property
|
||||
public static DependencyProperty IndicatorBrushProperty = DependencyProperty.Register("IndicatorBrush", typeof(Brush), typeof(HalfRoundProgressBar));
|
||||
public Brush IndicatorBrush {
|
||||
get { return (Brush)GetValue(IndicatorBrushProperty); }
|
||||
set { SetValue(IndicatorBrushProperty, value); }
|
||||
}
|
||||
|
||||
//Background Brush Property
|
||||
public static DependencyProperty BackgroundBrushProperty = DependencyProperty.Register("BackgroundBrush", typeof(Brush), typeof(HalfRoundProgressBar));
|
||||
public Brush BackgroundBrush {
|
||||
get { return (Brush)GetValue(BackgroundBrushProperty); }
|
||||
set { SetValue(BackgroundBrushProperty, value); }
|
||||
}
|
||||
|
||||
//ProgressBorder Property
|
||||
public static DependencyProperty ProgressBorderBrushProperty = DependencyProperty.Register("ProgressBorderBrush", typeof(Brush), typeof(HalfRoundProgressBar));
|
||||
public Brush ProgressBorderBrush {
|
||||
get { return (Brush)GetValue(ProgressBorderBrushProperty); }
|
||||
set { SetValue(ProgressBorderBrushProperty, value); }
|
||||
}
|
||||
|
||||
//Value
|
||||
public static DependencyProperty ValueProperty = DependencyProperty.Register("Value", typeof(int), typeof(HalfRoundProgressBar));
|
||||
public int Value {
|
||||
get { return (int)GetValue(ValueProperty); }
|
||||
|
||||
@@ -5,50 +5,27 @@
|
||||
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"
|
||||
mc:Ignorable="d"
|
||||
>
|
||||
mc:Ignorable="d">
|
||||
<!--The Loading indicator circle-->
|
||||
<Grid DataContext="{Binding RelativeSource={RelativeSource Self}}">
|
||||
<Path
|
||||
Stroke="Transparent"
|
||||
StrokeThickness=".5"
|
||||
RenderTransformOrigin=".5,.5"
|
||||
Width="60"
|
||||
Height="60"
|
||||
>
|
||||
<Path Stroke="Transparent" StrokeThickness=".5" RenderTransformOrigin=".5,.5" Width="60" Height="60">
|
||||
<Path.Effect>
|
||||
<DropShadowEffect BlurRadius="5" ShadowDepth="0" Opacity="1" Color="#B388FF"/>
|
||||
</Path.Effect>
|
||||
<Path.Data>
|
||||
<CombinedGeometry
|
||||
GeometryCombineMode="Xor"
|
||||
>
|
||||
<CombinedGeometry GeometryCombineMode="Xor">
|
||||
<CombinedGeometry.Geometry1>
|
||||
<EllipseGeometry
|
||||
RadiusX="30"
|
||||
RadiusY="30"
|
||||
Center="30,30"
|
||||
/>
|
||||
<EllipseGeometry RadiusX="30" RadiusY="30" Center="30,30"/>
|
||||
</CombinedGeometry.Geometry1>
|
||||
<CombinedGeometry.Geometry2>
|
||||
<EllipseGeometry
|
||||
RadiusX="24"
|
||||
RadiusY="24"
|
||||
Center="30,30"
|
||||
/>
|
||||
<EllipseGeometry RadiusX="24" RadiusY="24" Center="30,30"/>
|
||||
</CombinedGeometry.Geometry2>
|
||||
</CombinedGeometry>
|
||||
</Path.Data>
|
||||
<Path.Fill>
|
||||
<LinearGradientBrush
|
||||
StartPoint="0,0"
|
||||
EndPoint="1,1"
|
||||
>
|
||||
<GradientStop
|
||||
Color="#B388FF" Offset="0"
|
||||
/>
|
||||
<GradientStop
|
||||
Color="#A7FFEB" Offset="1"
|
||||
/>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#B388FF" Offset="0"/>
|
||||
<GradientStop Color="#A7FFEB" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Path.Fill>
|
||||
<Path.RenderTransform>
|
||||
@@ -56,17 +33,10 @@
|
||||
<!--This is necessary for the animation not to stop-->
|
||||
</Path.RenderTransform>
|
||||
<Path.Triggers>
|
||||
<EventTrigger
|
||||
RoutedEvent="Loaded"
|
||||
>
|
||||
<EventTrigger RoutedEvent="Loaded">
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<DoubleAnimation
|
||||
Storyboard.TargetProperty="(Rectangle.RenderTransform).(RotateTransform.Angle)"
|
||||
To="360"
|
||||
Duration="0:0:.8"
|
||||
RepeatBehavior="Forever"
|
||||
/>
|
||||
<DoubleAnimation Storyboard.TargetProperty="(Rectangle.RenderTransform).(RotateTransform.Angle)" To="360" Duration="0:0:.8" RepeatBehavior="Forever"/>
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</EventTrigger>
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Server_Dashboard.Controls.ServerModules"
|
||||
xmlns:halfroundprogressbar="clr-namespace:Server_Dashboard.Controls.HalfRoundProgressBar"
|
||||
xmlns:doubleroundprogressbar="clr-namespace:Server_Dashboard.Controls.DoubleRoundProgressBar"
|
||||
mc:Ignorable="d">
|
||||
xmlns:doubleroundprogressbar="clr-namespace:Server_Dashboard.Controls.DoubleRoundProgressBar" mc:Ignorable="d">
|
||||
<!--Module-->
|
||||
<Border Background="{StaticResource BackgroundSurface_02dp}" MinHeight="100" MinWidth="300" Width="Auto" Height="Auto" Margin="10" CornerRadius="5">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect BlurRadius="5" ShadowDepth="0"/>
|
||||
@@ -16,11 +16,8 @@
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border
|
||||
CornerRadius="5 5 0 0"
|
||||
Grid.Row="0"
|
||||
Background="{StaticResource BackgroundSurface_08dp}"
|
||||
>
|
||||
<!--Top Bar-->
|
||||
<Border CornerRadius="5 5 0 0" Grid.Row="0" Background="{StaticResource BackgroundSurface_08dp}" >
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
@@ -48,11 +45,13 @@
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
<!--Main Content-->
|
||||
<Grid Grid.Row="2" Margin="20" Width="Auto">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1.5*"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<!--Information pannel, left-->
|
||||
<Grid Grid.Row="1" Margin="0 0 25 0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
@@ -133,6 +132,7 @@
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<!--Graphical Indicators Right-->
|
||||
<Grid Grid.Row="1" Grid.Column="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
@@ -143,117 +143,25 @@
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<halfroundprogressbar:HalfRoundProgressBar
|
||||
Margin="5"
|
||||
Grid.Row="0"
|
||||
ProgressBorderBrush="{StaticResource BackgroundSurface_02dp}"
|
||||
BackgroundBrush="{StaticResource BackgroundSurface_08dp}"
|
||||
Height="100"
|
||||
Width="100"
|
||||
Value="{Binding ServerInfo.CpuUsage}"
|
||||
IndicatorBrush="{StaticResource Teal_A100}"
|
||||
/>
|
||||
<TextBlock
|
||||
Foreground="{StaticResource Teal_A100}"
|
||||
Grid.Row="0"
|
||||
Text="CPU"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center"
|
||||
FontSize="18"
|
||||
/>
|
||||
<halfroundprogressbar:HalfRoundProgressBar
|
||||
Margin="5"
|
||||
Grid.Row="1"
|
||||
ProgressBorderBrush="{StaticResource BackgroundSurface_02dp}"
|
||||
BackgroundBrush="{StaticResource BackgroundSurface_08dp}"
|
||||
Height="100"
|
||||
Width="100"
|
||||
Value="{Binding ServerInfo.GpuUsage}"
|
||||
IndicatorBrush="{StaticResource Teal_A100}"
|
||||
/>
|
||||
<TextBlock
|
||||
Foreground="{StaticResource Teal_A100}"
|
||||
Grid.Row="1"
|
||||
Text="GPU"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center"
|
||||
FontSize="18"
|
||||
/>
|
||||
<halfroundprogressbar:HalfRoundProgressBar Margin="5" Grid.Row="0" ProgressBorderBrush="{StaticResource BackgroundSurface_02dp}" BackgroundBrush="{StaticResource BackgroundSurface_08dp}" Height="100" Width="100" Value="{Binding ServerInfo.CpuUsage}" IndicatorBrush="{StaticResource Teal_A100}"/>
|
||||
<TextBlock Foreground="{StaticResource Teal_A100}" Grid.Row="0" Text="CPU" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18"/>
|
||||
<halfroundprogressbar:HalfRoundProgressBar Margin="5" Grid.Row="1" ProgressBorderBrush="{StaticResource BackgroundSurface_02dp}" BackgroundBrush="{StaticResource BackgroundSurface_08dp}" Height="100" Width="100" Value="{Binding ServerInfo.GpuUsage}" IndicatorBrush="{StaticResource Teal_A100}"/>
|
||||
<TextBlock Foreground="{StaticResource Teal_A100}" Grid.Row="1" Text="GPU" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18"/>
|
||||
</Grid>
|
||||
<Grid Grid.Column="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<doubleroundprogressbar:DoubleRoundProgressBar
|
||||
ValueRead="70"
|
||||
ValueWrite="60"
|
||||
ReadIndicatorBrush="{StaticResource DeepPurple_A100}"
|
||||
WriteIndicatorBrush="{StaticResource Teal_A100}"
|
||||
Margin="5"
|
||||
Grid.Row="0"
|
||||
ProgressBorderBrush="{StaticResource BackgroundSurface_02dp}"
|
||||
BackgroundBrush="{StaticResource BackgroundSurface_08dp}"
|
||||
Height="100"
|
||||
Width="100"
|
||||
/>
|
||||
<StackPanel
|
||||
Grid.Row="0"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center">
|
||||
<TextBlock
|
||||
Grid.Row="0"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center"
|
||||
FontSize="18"
|
||||
TextAlignment="Center"
|
||||
Text="Read"
|
||||
Foreground="{StaticResource DeepPurple_A100}"
|
||||
/>
|
||||
<TextBlock
|
||||
Grid.Row="0"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center"
|
||||
FontSize="18"
|
||||
TextAlignment="Center"
|
||||
Text="Write"
|
||||
Foreground="{StaticResource Teal_A100}"
|
||||
/>
|
||||
<doubleroundprogressbar:DoubleRoundProgressBar ValueRead="70" ValueWrite="60" ReadIndicatorBrush="{StaticResource DeepPurple_A100}" WriteIndicatorBrush="{StaticResource Teal_A100}" Margin="5" Grid.Row="0" ProgressBorderBrush="{StaticResource BackgroundSurface_02dp}" BackgroundBrush="{StaticResource BackgroundSurface_08dp}" Height="100" Width="100"/>
|
||||
<StackPanel Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center">
|
||||
<TextBlock Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18" TextAlignment="Center" Text="Read" Foreground="{StaticResource DeepPurple_A100}"/>
|
||||
<TextBlock Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18" TextAlignment="Center" Text="Write" Foreground="{StaticResource Teal_A100}"/>
|
||||
</StackPanel>
|
||||
<doubleroundprogressbar:DoubleRoundProgressBar
|
||||
ValueRead="70"
|
||||
ValueWrite="60"
|
||||
ReadIndicatorBrush="{StaticResource DeepPurple_A100}"
|
||||
WriteIndicatorBrush="{StaticResource Teal_A100}"
|
||||
Margin="5"
|
||||
Grid.Row="1"
|
||||
ProgressBorderBrush="{StaticResource BackgroundSurface_02dp}"
|
||||
BackgroundBrush="{StaticResource BackgroundSurface_08dp}"
|
||||
Height="100"
|
||||
Width="100"
|
||||
/>
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center">
|
||||
<TextBlock
|
||||
Grid.Row="0"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center"
|
||||
FontSize="18"
|
||||
TextAlignment="Center"
|
||||
Text="UP"
|
||||
Foreground="{StaticResource DeepPurple_A100}"
|
||||
/>
|
||||
<TextBlock
|
||||
Grid.Row="0"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center"
|
||||
FontSize="18"
|
||||
TextAlignment="Center"
|
||||
Text="DOWN"
|
||||
Foreground="{StaticResource Teal_A100}"
|
||||
/>
|
||||
<doubleroundprogressbar:DoubleRoundProgressBar ValueRead="70" ValueWrite="60" ReadIndicatorBrush="{StaticResource DeepPurple_A100}" WriteIndicatorBrush="{StaticResource Teal_A100}" Margin="5" Grid.Row="1" ProgressBorderBrush="{StaticResource BackgroundSurface_02dp}" BackgroundBrush="{StaticResource BackgroundSurface_08dp}" Height="100" Width="100"/>
|
||||
<StackPanel Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center">
|
||||
<TextBlock Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18" TextAlignment="Center" Text="UP" Foreground="{StaticResource DeepPurple_A100}"/>
|
||||
<TextBlock Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18" TextAlignment="Center" Text="DOWN" Foreground="{StaticResource Teal_A100}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
Reference in New Issue
Block a user