-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
154 lines (145 loc) · 7.37 KB
/
Copy pathMainWindow.xaml
File metadata and controls
154 lines (145 loc) · 7.37 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
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
<Window x:Class="VioletTooth.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="VioletTooth"
Icon="/app.ico"
Height="580"
Width="860"
MinHeight="480"
MinWidth="720"
Background="#F4F6F8"
WindowStartupLocation="CenterScreen">
<Window.Resources>
<Style TargetType="Button">
<Setter Property="Padding" Value="12,6"/>
<Setter Property="Margin" Value="0,0,8,0"/>
<Setter Property="Background" Value="#6366F1"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="Bd"
Background="{TemplateBinding Background}"
CornerRadius="6"
Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="Bd" Property="Opacity" Value="0.45"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Opacity" Value="0.9"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="DangerButton" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Background" Value="#CF222E"/>
</Style>
<Style x:Key="SecondaryButton" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Background" Value="#57606A"/>
</Style>
</Window.Resources>
<Grid Margin="20">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<DockPanel Grid.Row="0" Margin="0,0,0,14">
<StackPanel Orientation="Horizontal" DockPanel.Dock="Right">
<Button x:Name="KickSettingsButton" Style="{StaticResource SecondaryButton}" Click="KickSettings_Click"/>
<Button x:Name="RefreshButton" Click="RefreshPaired_Click"/>
<Button x:Name="ScanButton" Click="Scan_Click"/>
<Button x:Name="StopScanButton" Style="{StaticResource SecondaryButton}" Click="StopScan_Click"/>
</StackPanel>
<StackPanel>
<TextBlock x:Name="TitleText" Text="VioletTooth" FontSize="22" FontWeight="SemiBold" Foreground="#1F2328"/>
<TextBlock x:Name="SubtitleText"
Margin="0,4,0,0"
Foreground="#656D76"/>
</StackPanel>
</DockPanel>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="16"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0" Background="White" CornerRadius="10" Padding="12">
<DockPanel>
<DockPanel DockPanel.Dock="Top" Margin="0,0,0,10">
<Button x:Name="UnpairButton"
DockPanel.Dock="Right"
Style="{StaticResource DangerButton}"
Click="Unpair_Click"/>
<TextBlock x:Name="PairedTitle" FontSize="15" FontWeight="SemiBold" VerticalAlignment="Center"/>
</DockPanel>
<ListBox x:Name="PairedList"
BorderThickness="0"
SelectionChanged="PairedList_SelectionChanged">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Margin="0,4">
<TextBlock Text="{Binding Name}" FontWeight="SemiBold"/>
<TextBlock Foreground="#656D76" FontSize="12">
<Run Text="{Binding StatusText, Mode=OneWay}"/>
<Run Text=" · "/>
<Run Text="{Binding Address, Mode=OneWay}"/>
</TextBlock>
<TextBlock Text="{Binding LastConnectedText}" Foreground="#6366F1" FontSize="12"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</DockPanel>
</Border>
<Border Grid.Column="2" Background="White" CornerRadius="10" Padding="12">
<DockPanel>
<DockPanel DockPanel.Dock="Top" Margin="0,0,0,10">
<Button x:Name="PairButton"
DockPanel.Dock="Right"
Click="Pair_Click"/>
<TextBlock x:Name="NearbyTitle" FontSize="15" FontWeight="SemiBold" VerticalAlignment="Center"/>
</DockPanel>
<ListBox x:Name="NearbyList" BorderThickness="0">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Margin="0,4">
<TextBlock Text="{Binding Name}" FontWeight="SemiBold"/>
<TextBlock Foreground="#656D76" FontSize="12">
<Run Text="{Binding StatusText, Mode=OneWay}"/>
<Run Text=" · "/>
<Run Text="{Binding Address, Mode=OneWay}"/>
</TextBlock>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</DockPanel>
</Border>
</Grid>
<CheckBox x:Name="StartupCheckBox"
Grid.Row="2"
Margin="0,12,0,0"
Checked="StartupCheckBox_Changed"
Unchecked="StartupCheckBox_Changed"/>
<DockPanel Grid.Row="3" Margin="0,10,0,0" LastChildFill="True">
<ComboBox x:Name="LanguageCombo"
DockPanel.Dock="Right"
Width="110"
VerticalAlignment="Center"
SelectionChanged="LanguageCombo_SelectionChanged"/>
<TextBlock x:Name="StatusText"
VerticalAlignment="Center"
Foreground="#656D76"
TextTrimming="CharacterEllipsis"/>
</DockPanel>
</Grid>
</Window>