-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
120 lines (120 loc) · 5.41 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<Window x:Class="AudioScheduler.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:local="clr-namespace:AudioScheduler"
xmlns:model="clr-namespace:AudioScheduler.Model"
xmlns:componentModel="clr-namespace:System.ComponentModel;assembly=WindowsBase"
mc:Ignorable="d"
ResizeMode="NoResize"
WindowStartupLocation="CenterScreen"
Title="Audio Scheduler"
Height="350"
Width="850">
<Window.Resources>
<CollectionViewSource x:Key="EventViewSource"
d:DesignSource="{d:DesignInstance {x:Type model:Event}, CreateList=True}">
<CollectionViewSource.SortDescriptions>
<componentModel:SortDescription PropertyName="Time"
Direction="Ascending" />
</CollectionViewSource.SortDescriptions>
</CollectionViewSource>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0"
Text="Schedule is Good"
Foreground="Green"
FontWeight="Bold"
TextAlignment="Center"
Name="StatusText" />
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid Grid.Column="0"
DataContext="{DynamicResource EventViewSource}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Grid.Row="1"
Text="Today's Schedule"
TextAlignment="Center" />
<DataGrid Grid.Row="1"
ItemsSource="{Binding}"
AutoGenerateColumns="False"
CanUserReorderColumns="False"
CanUserResizeColumns="False"
CanUserResizeRows="False"
CanUserSortColumns="False"
IsReadOnly="True">
<DataGrid.Columns>
<DataGridComboBoxColumn x:Name="SoundDg"
SelectedItemBinding="{Binding Sound}"
SelectedValuePath="Id"
DisplayMemberPath="Name"
Header="Sound"
Width="0.6*" />
<DataGridTextColumn Binding="{Binding TimeString}"
Header="Time"
Width="0.4*" />
</DataGrid.Columns>
</DataGrid>
</Grid>
<UniformGrid Grid.Column="1"
Columns="1"
Rows="7">
<TextBlock TextAlignment="Center"
Text="Currently Playing:"
Margin="10 10 10 0" />
<TextBlock Name="TextBlock"
Text="{Binding UpdateSourceTrigger=PropertyChanged, Path=Playing}"
d:DataContext="{d:DesignInstance }"
TextAlignment="Center"
Margin="10 0 10 10" />
<TextBlock Text="Select a sound:"
TextAlignment="Center"
Margin="10 10 10 0" />
<ComboBox Name="SoundCb"
DisplayMemberPath="Name"
SelectedIndex="0"
Margin="30 0 30 20" />
<Button Content="Play"
Click="PlaySound"
Margin="60 10 60 10" />
<Button Content="Play TTS"
Click="PlayTts"
Margin="60 10 60 10" />
<Button Content="Stop Playing"
Click="StopSound"
Margin="60 10 60 10" />
</UniformGrid>
<UniformGrid Grid.Column="2"
Columns="1"
Rows="5">
<Button Content="Edit Schedule"
Click="OpenEditDays"
Margin="20" />
<Button Content="Edit Sounds"
Click="OpenEditSounds"
Margin="20" />
<Button Content="Edit Templates"
Click="OpenEditTemplates"
Margin="20" />
<Button Content="Settings"
Click="OpenSettings"
Margin="20" />
<Button Content="Help"
Click="OpenHelp"
Margin="20" />
</UniformGrid>
</Grid>
</Grid>
</Window>