-
Notifications
You must be signed in to change notification settings - Fork 803
Expand file tree
/
Copy pathStatusWindow.xaml
More file actions
95 lines (95 loc) · 5.27 KB
/
StatusWindow.xaml
File metadata and controls
95 lines (95 loc) · 5.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<mah:MetroWindow x:Class="NETworkManager.StatusWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mah="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:localization="clr-namespace:NETworkManager.Localization.Resources;assembly=NETworkManager.Localization"
xmlns:resources="clr-namespace:NETworkManager.Properties"
xmlns:networkManager="clr-namespace:NETworkManager"
xmlns:converters="clr-namespace:NETworkManager.Converters;assembly=NETworkManager.Converters"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
mc:Ignorable="d" d:DataContext="{d:DesignInstance networkManager:StatusWindow}"
TitleAlignment="Left"
Style="{DynamicResource DefaultWindow}"
Deactivated="MetroWindow_Deactivated"
Topmost="True"
ShowInTaskbar="False"
Width="950"
Height="241"
ResizeMode="NoResize"
IsWindowDraggable="False"
ShowMinButton="False"
ShowMaxRestoreButton="False"
ShowCloseButton="True"
ShowTitleBar="True"
Closing="MetroWindow_Closing">
<mah:MetroWindow.Resources>
<converters:BooleanToVisibilityCollapsedConverter x:Key="BooleanToVisibilityCollapsedConverter" />
<converters:TimeToStrokeDashOffsetConverter x:Key="TimeToStrokeDashOffsetConverter" />
</mah:MetroWindow.Resources>
<mah:MetroWindow.LeftWindowCommands>
<mah:WindowCommands ShowSeparators="False">
<!-- Countdown progress ring -->
<Grid Width="20" Height="20"
Visibility="{Binding ShowTime, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}"
VerticalAlignment="Center"
Margin="10,0,0,0">
<!-- Track (background ring) -->
<Ellipse StrokeThickness="2.5"
Stroke="{DynamicResource MahApps.Brushes.Accent}"
Opacity="0.2" />
<!-- Foreground arc that shrinks as time counts down -->
<Ellipse StrokeThickness="2.5"
Stroke="{DynamicResource MahApps.Brushes.Accent}"
StrokeDashCap="Round"
StrokeDashArray="22 100"
RenderTransformOrigin="0.5,0.5">
<Ellipse.RenderTransform>
<RotateTransform Angle="-90" />
</Ellipse.RenderTransform>
<Ellipse.StrokeDashOffset>
<MultiBinding Converter="{StaticResource TimeToStrokeDashOffsetConverter}"
ConverterParameter="22.0">
<Binding Path="Time" />
<Binding Path="TimeMax" />
</MultiBinding>
</Ellipse.StrokeDashOffset>
</Ellipse>
</Grid>
</mah:WindowCommands>
</mah:MetroWindow.LeftWindowCommands>
<mah:MetroWindow.RightWindowCommands>
<mah:WindowCommands ShowSeparators="False">
<Button Command="{Binding Path=ReloadCommand}"
ToolTip="{x:Static Member=localization:Strings.ToolTip_RunCommandWithHotKey}"
Cursor="Hand"
Focusable="False"
Margin="0,0,5,0">
<StackPanel Orientation="Horizontal">
<Rectangle Width="16" Height="16"
Fill="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=Foreground}">
<Rectangle.OpacityMask>
<VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=Refresh}" />
</Rectangle.OpacityMask>
</Rectangle>
</StackPanel>
</Button>
<Button Command="{Binding Path=ShowMainWindowCommand}"
ToolTip="{x:Static Member=localization:Strings.ToolTip_RunCommandWithHotKey}"
Cursor="Hand"
Focusable="False"
Margin="0,0,5,0">
<StackPanel Orientation="Horizontal">
<Rectangle Width="16" Height="16"
Fill="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=Foreground}">
<Rectangle.OpacityMask>
<VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=OpenInNew}" />
</Rectangle.OpacityMask>
</Rectangle>
</StackPanel>
</Button>
</mah:WindowCommands>
</mah:MetroWindow.RightWindowCommands>
<ContentControl Margin="10,5,10,10" x:Name="ContentControlNetworkConnection" />
</mah:MetroWindow>