-
Notifications
You must be signed in to change notification settings - Fork 0
/
appMessageBox.xaml
139 lines (120 loc) · 7.39 KB
/
appMessageBox.xaml
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<Window x:Class="Wake_On_Lan_Lite.appMessageBox"
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:local="clr-namespace:Wake_On_Lan_Lite"
mc:Ignorable="d"
Title="Error" Height="125" Width="210"
Background="#181735"
ResizeMode="NoResize">
<!--Setup of the personnal title bar-->
<WindowChrome.WindowChrome>
<WindowChrome x:Name="windowChrome" CaptionHeight="27" />
</WindowChrome.WindowChrome>
<!-- Buttons style and actions -->
<Window.Resources>
<ResourceDictionary>
<!--Style for title bar buttons-->
<Style x:Key="CaptionButtonStyle" TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid x:Name="LayoutRoot" Background="Transparent" Width="50" Height="30" VerticalAlignment="Top">
<TextBlock x:Name="txt" Text="{TemplateBinding Content}" FontFamily="Segoe MDL2 Assets" FontSize="10"
Foreground="#37c1fe" HorizontalAlignment="Center" VerticalAlignment="Center"
RenderOptions.ClearTypeHint="Auto" TextOptions.TextRenderingMode="Aliased" TextOptions.TextFormattingMode="Display"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="LayoutRoot" Property="Background" Value="#181735"/>
<Setter TargetName="txt" Property="Foreground" Value="White"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--Minimize function-->
<Style x:Key="MinimizeButtonStyle" TargetType="Button" BasedOn="{StaticResource CaptionButtonStyle}">
<Setter Property="Content" Value=""/>
</Style>
<!--Close function-->
<Style x:Key="CloseButtonStyle" TargetType="Button" BasedOn="{StaticResource CaptionButtonStyle}">
<Setter Property="Content" Value=""/>
</Style>
<!--App buttons template-->
<ControlTemplate x:Key="appButtonTemplate" TargetType="Button">
<Border Width="75" Height="35" CornerRadius="15" Background="{TemplateBinding Background}">
<ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center" />
</Border>
</ControlTemplate>
<!--App buttons style-->
<Style x:Key="appButtonStyle" TargetType="Button">
<Setter Property="TextElement.FontFamily" Value="Fonts/#Dosis" />
<Setter Property="Background" Value="#37c1fe" />
<Setter Property="Foreground" Value="White" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="FontSize" Value="15" />
<Setter Property="FontWeight" Value="Medium" />
<Setter Property="Margin" Value="0, 0, 10, 0" />
<Style.Triggers>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="#3DDDC2" />
<Setter Property="Foreground" Value="White" />
</Trigger>
</Style.Triggers>
</Style>
<!--App label style-->
<Style x:Key="appLabelStyle" TargetType="Label">
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Foreground" Value="#37c1fe" />
<Setter Property="FontSize" Value="15" />
<Setter Property="FontWeight" Value="Medium" />
<Setter Property="FontFamily" Value="Fonts/#Dosis" />
</Style>
</ResourceDictionary>
</Window.Resources>
<!--Title bar button commands-->
<Window.CommandBindings>
<CommandBinding Command="{x:Static SystemCommands.MinimizeWindowCommand}" CanExecute="CommandBinding_CanExecute"
Executed="CommandBinding_Executed_Minimize" />
<CommandBinding Command="{x:Static SystemCommands.CloseWindowCommand}" CanExecute="CommandBinding_CanExecute" Executed="CommandBinding_Executed_Close" />
</Window.CommandBindings>
<!-- Main content -->
<Border x:Name="MainWindowBorder" BorderBrush="Transparent" BorderThickness="0" >
<Grid Background="#0F0F2D">
<Grid.RowDefinitions>
<RowDefinition Height ="30"/>
<RowDefinition />
</Grid.RowDefinitions>
<!--Window chrome-->
<Grid Grid.Row="0" Height="30" Background="#181735">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center">
<!--App icon-->
<!--<Image Source="/Resources/wol.ico" Width="18" Margin="2" HorizontalAlignment="Left" VerticalAlignment="Center" />-->
<TextBlock x:Name="editDeviceTitle" Text="Error" Margin="10 3 0 0" Foreground="#37c1fe"/>
</StackPanel>
<!--Caption buttons-->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" >
<Button Style="{StaticResource MinimizeButtonStyle}" WindowChrome.IsHitTestVisibleInChrome="True" ToolTip="Minimize"
Command="{x:Static SystemCommands.MinimizeWindowCommand}"/>
<Button Style="{StaticResource CloseButtonStyle}" WindowChrome.IsHitTestVisibleInChrome="True" ToolTip="Close"
Command="{x:Static SystemCommands.CloseWindowCommand}"/>
</StackPanel>
</Grid>
<!--Main content-->
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<!--textBox-->
<Label x:Name="message" Grid.Row="0" Style="{StaticResource appLabelStyle}"></Label>
<!--button-->
<Button Content="Close" Grid.Row="1" Click="closeWindow" Style="{StaticResource appButtonStyle}" Template="{StaticResource appButtonTemplate}"></Button>
</Grid>
</Grid>
</Border>
</Window>