-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
81 lines (71 loc) · 4.55 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
<Window xmlns:Wpf="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf" x:Class="YouTubeTracker.MainWindow"
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:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"
xmlns:local="clr-namespace:YouTubeTracker"
mc:Ignorable="d" FontSize="18" Background="Black" Foreground="WhiteSmoke"
Title="MainWindow" Height="450" Width="800">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="20" />
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="20" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="20" />
<RowDefinition Height="auto" />
<RowDefinition Height="*" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="20" />
</Grid.RowDefinitions>
<TextBlock Grid.Column="1" Grid.Row="1" FontWeight="Bold" Text="Enter phrase" Margin="5"/>
<TextBox x:Name="videoPhrase" Grid.Column="2" Grid.Row="1" Margin="5"/>
<Button x:Name="searchButton" Content=" Search " Grid.Column="3" Grid.Row="1"
Margin="5" Click="SearchButton_Click" />
<TextBlock Grid.Column="4" Grid.Row="1" Text="Max Search Results:" Margin="5"/>
<TextBox x:Name="maxSearchResults" Grid.Column="4" Grid.Row="1" Margin="170,5,5,5" Width="25"
Text="10" PreviewTextInput="PreviewTextInput"/>
<ListBox x:Name="videoListBox" Grid.Column="4" Grid.Row="2" Margin="10"
Background="Black" Foreground="WhiteSmoke" Grid.ColumnSpan="3" >
<ListBox.ItemTemplate >
<DataTemplate DataType="{x:Type local:ListBoxItem}" >
<StackPanel Orientation="Horizontal">
<Image Margin="3" Width="120" Height="90" Source="{Binding image}"/>
<TextBlock Margin="3" Text="{Binding text}"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="5" Margin="5" Grid.ColumnSpan="2">
<TextBlock x:Name="selectionText" FontWeight="Bold" Text=" View: " Margin="40,0,0,0"/>
<RadioButton x:Name="searchtRadioButton" Margin="5,0,0,0" IsChecked="True" Checked="SearchRB_Checked"
GroupName="ViewSelection" Foreground="WhiteSmoke">Search</RadioButton>
<RadioButton x:Name="playlistRadioButton" Margin="5,0,0,0" IsChecked="False" Checked="PlaylistRB_Checked"
GroupName="ViewSelection" Foreground="WhiteSmoke">Playlist</RadioButton>
</StackPanel>
<TextBlock x:Name="playlistInfo" Grid.Column="4" Grid.Row="3" Margin="5" Text="Playlist info: "
Grid.ColumnSpan="3"/>
<ComboBox x:Name="playlistsCB" Grid.Column="4" Grid.Row="4" Margin="5" SelectionChanged="PlaylistComboBox_Changed" />
<Button x:Name="addPlaylistButton" Content=" Create playlist " Grid.Column="5" Grid.Row="4"
Margin="5" Click="CreatePlaylistButton_Click"/>
<Button x:Name="removePlaylistButton" Content=" Delete playlist " Grid.Column="6" Grid.Row="4"
Margin="5" Click="DeletePlaylistButton_Click"/>
<Button x:Name="playButton" Content=" Play " Grid.Column="4" Grid.Row="5"
Margin="5" Click="PlayButton_Click"/>
<Button x:Name="addToPlaylistButton" Content=" Add to playlist " Grid.Column="5" Grid.Row="5"
Margin="5" Click="AddToPlaylistButton_Click"/>
<Button x:Name="removeFromPlaylistButton" Content=" Remove from playlist " Grid.Column="6" Grid.Row="5"
Margin="5" Click="RemoveFromPlaylistButton_Click"/>
<wv2:WebView2 x:Name="videoWeb" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3"
Grid.RowSpan="4" Margin="0,0,8,0" Source="https://www.youtube.com/embed"/>
</Grid>
</Window>