-
Notifications
You must be signed in to change notification settings - Fork 0
/
editDevice.xaml
178 lines (156 loc) · 9.45 KB
/
editDevice.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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<Window x:Class="Wake_On_Lan_Lite.editDevice"
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="editDevice" Height="200" Width="300"
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 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 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 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>
<!--App textbox style-->
<Style x:Key="appTextboxStyle" TargetType="TextBox">
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Width" Value="150" />
<Setter Property="Height" Value="30" />
<Setter Property="Background" Value="#37c1fe" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="Foreground" Value="White" />
<Setter Property="FontSize" Value="15" />
<Setter Property="FontWeight" Value="Medium" />
<Setter Property="FontFamily" Value="Fonts/#Dosis" />
<Setter Property="CaretBrush" Value="White" />
<Setter Property="Padding" Value="10 0" />
<Style.Resources>
<Style TargetType="Border">
<Setter Property="CornerRadius" Value="15" />
</Style>
</Style.Resources>
</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="Wake On Lan Lite" 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 />
<RowDefinition />
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Label Grid.Column="0" Style="{StaticResource appLabelStyle}" >Name :</Label>
<TextBox Grid.Column="1" x:Name="nameTextBox" Style="{StaticResource appTextboxStyle}" ></TextBox>
</Grid>
<Grid Grid.Row="1" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Label Grid.Column="0" Style="{StaticResource appLabelStyle}">Address :</Label>
<TextBox Grid.Column="1" x:Name="addressTextBox" Style="{StaticResource appTextboxStyle}" ></TextBox>
</Grid>
<Grid Grid.Row="2">
<Button x:Name="editDeviceButton" Content="Edit" Click="editDeviceClick" Style="{StaticResource appButtonStyle}"
Template="{StaticResource appButtonTemplate}"></Button>
</Grid>
</Grid>
</Grid>
</Border>
</Window>