-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
97 lines (92 loc) · 4.8 KB
/
MainWindow.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
<Window x:Class="AudioDeviceSwitcher.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Desktop Audio Switcher"
Width="300"
Height="200"
Loaded="Window_Loaded"
ResizeMode="CanMinimize"
Icon="/assets/sound-card.png"
WindowStyle="None"
UseLayoutRounding="True"
Background="#FF462C2C"
BorderBrush="#FF0E0E0E"
MouseDown="Window_MouseDown">
<Grid>
<ListBox x:Name="DeviceListBox" Margin="4,0,4,4" SelectionMode="Single" FontSize="10" SelectionChanged="DeviceListBox_SelectionChanged" Foreground="White" BorderBrush="{x:Null}" Padding="0,0,0,0" BorderThickness="0,0,0,0" Height="2" VerticalAlignment="Bottom" Background="{x:Null}" HorizontalContentAlignment="Stretch">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Background" Value="#FF7F8E94" />
<Setter Property="Foreground" Value="#FF131313" />
<Setter Property="BorderBrush" Value="{x:Null}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<Border Name="Border" Background="{TemplateBinding Background}" Padding="5,2,5,2" SnapsToDevicePixels="True">
<ContentPresenter />
</Border>
<ControlTemplate.Triggers>
<!-- Hover Trigger -->
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Border" Property="Background" Value="#FFFFEB3A" />
<Setter Property="Foreground" Value="Black"></Setter>
</Trigger>
<!-- Selected Trigger -->
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="Border" Property="Background" Value="#FF19756E" />
<Setter Property="Foreground" Value="White"></Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
<Button x:Name="Minimize_btn"
HorizontalAlignment="Right"
Margin="0,6,19,0"
VerticalAlignment="Top"
BorderThickness="0"
Width="9"
Height="9"
Click="Minimize_btn_Click"
Padding="0">
<Button.Template>
<ControlTemplate TargetType="Button">
<Grid>
<!-- Define the Image as part of the ControlTemplate -->
<Image x:Name="MinimizeImage" Source="/assets/minimize.png" Stretch="Fill" />
</Grid>
<ControlTemplate.Triggers>
<!-- Hover Trigger -->
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="MinimizeImage" Property="Opacity" Value="0.8" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>
<Button x:Name="Close_btn" HorizontalAlignment="Right" Margin="0,6,5,0" VerticalAlignment="Top" BorderThickness="0" Width="9" Height="9" Click="Close_btn_Click" Padding="0">
<Button.Template>
<ControlTemplate TargetType="Button">
<Grid>
<!-- Define the Image as part of the ControlTemplate -->
<Image x:Name="ButtonImage" Source="/assets/close.png" Stretch="Fill" />
</Grid>
<ControlTemplate.Triggers>
<!-- Hover Trigger -->
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="ButtonImage" Property="Source" Value="/assets/close.png" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>
<Rectangle HorizontalAlignment="Center" Height="40" Margin="8,0,0,0" VerticalAlignment="Top" Width="40">
<Rectangle.Fill>
<ImageBrush ImageSource="/assets/sound-card.png"/>
</Rectangle.Fill>
</Rectangle>
</Grid>
</Window>