-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMain.xaml
232 lines (211 loc) · 17.4 KB
/
Main.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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
<Window x:Class="Presenter.Main"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Presenter="clr-namespace:Presenter"
xmlns:Code="clr-namespace:Presenter.App_Code"
xmlns:Loc="clr-namespace:Presenter.Resources"
xml:lang="en-US"
Title="{x:Static Loc:Labels.MainWindowTitle}" Height="768" Width="1024" WindowState="Maximized" KeyDown="Window_KeyDown" Closed="Main_Closed" FlowDirection="LeftToRight" FontSize="{Binding Source={x:Static Code:Config.instance}, Path=FontSizeProperty}">
<Window.Resources>
<Code:ScaleValueConverter x:Key="ScaleValueConverter" />
</Window.Resources>
<Grid Name="Grid1">
<Grid.ColumnDefinitions>
<ColumnDefinition Name="col1" />
<ColumnDefinition Name="col2" />
<ColumnDefinition Name="col3" Width="0" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Name="row1" />
<RowDefinition Name="row2" Height="310" />
</Grid.RowDefinitions>
<ToolBar VerticalAlignment="Top" Grid.ColumnSpan="3" Grid.Row="0">
<Button Click="Planner_Click" VerticalAlignment="Top">
<StackPanel>
<Image Width="32" Source="icons/calendar_date.png" HorizontalAlignment="Center" />
<TextBlock Text="{x:Static Loc:Labels.MainMenuPlanner}" HorizontalAlignment="Center" />
</StackPanel>
</Button>
<Separator/>
<Button Click="Options_Click" VerticalAlignment="Top">
<StackPanel>
<Image Width="32" Source="icons/process.png" HorizontalAlignment="Center" />
<TextBlock Text="{x:Static Loc:Labels.MainMenuOptions}" HorizontalAlignment="Center" />
</StackPanel>
</Button>
<Button Click="RemoteMode_Click" VerticalAlignment="Top">
<StackPanel>
<Image Width="32" Source="icons/user.png" HorizontalAlignment="Center" />
<TextBlock Text="{x:Static Loc:Labels.MainMenuRemote}" HorizontalAlignment="Center" />
</StackPanel>
</Button>
<Button Name="ShowMessageBtn" Click="ShowMessage" VerticalAlignment="Top">
<StackPanel>
<Image Width="32" Source="icons/mail.png" HorizontalAlignment="Center" />
<TextBlock Text="{x:Static Loc:Labels.MainMenuMessage}" HorizontalAlignment="Center" />
</StackPanel>
</Button>
<Separator/>
<Button Click="ReportsList_Click" VerticalAlignment="Top">
<StackPanel>
<Image Width="32" Source="icons/page_preview.png" HorizontalAlignment="Center" />
<TextBlock Text="{x:Static Loc:Labels.MainMenuReportList}" HorizontalAlignment="Center" />
</StackPanel>
</Button>
<Button Click="ReportsUsage_Click" VerticalAlignment="Top">
<StackPanel>
<Image Width="32" Source="icons/page_preview.png" HorizontalAlignment="Center" />
<TextBlock Text="{x:Static Loc:Labels.MainMenuReportUsage}" HorizontalAlignment="Center" />
</StackPanel>
</Button>
<Separator/>
<Button Click="About_Click" VerticalAlignment="Top">
<StackPanel>
<Image Width="32" Source="icons/info.png" HorizontalAlignment="Center" />
<TextBlock Text="{x:Static Loc:Labels.MainMenuAbout}" HorizontalAlignment="Center" />
</StackPanel>
</Button>
</ToolBar>
<Grid Name="LibraryGrid" Grid.RowSpan="2">
<TextBlock Text="{x:Static Loc:Labels.MainHeaderLibrary}" Height="28" HorizontalAlignment="Left" Margin="12,60,0,0" VerticalAlignment="Top" FontSize="20" Padding="0" />
<TextBlock Text="{x:Static Loc:Labels.MainLabelLocation}" Height="23" HorizontalAlignment="Left" Margin="12,94,0,0" VerticalAlignment="Top" Width="63" Padding="0" />
<ComboBox Name="LocationList" Height="23" Margin="81,94,80,0" VerticalAlignment="Top" SelectionChanged="LocationList_SelectionChanged" />
<Button Name="RefreshBtn" MinWidth="52" Padding="2" Margin="0,94,17,0" HorizontalAlignment="Right" VerticalAlignment="Top" Content="{x:Static Loc:Labels.MainBtnRefresh}" Click="RefreshLocations" />
<TextBlock Text="{x:Static Loc:Labels.MainLabelSearch}" Margin="12,128,0,0" Height="23" HorizontalAlignment="Left" VerticalAlignment="Top" Width="120" Padding="0" />
<TextBox Name="SearchTerms" Height="23" Margin="81,128,17,0" VerticalAlignment="Top" TextChanged="SearchTerms_TextChanged" />
<ListBox Name="FileList" Margin="12,168,17,46" KeyUp="FileList_KeyUp" MouseDoubleClick="FileList_MouseDoubleClick" SelectionChanged="FileList_SelectionChanged" PreviewMouseMove="DragDrop_MouseMove" AllowDrop="True" Drop="DragDrop_DropHandler" SelectionMode="Extended">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<!-- set width to 0.9 of containing listbox so that context menu works anywhere along listboxitem and to 0.9 to not unecessarily cause scroll bar to appear -->
<TextBlock Text="{Binding}" MinWidth="{Binding ElementName=FileList, Path=ActualWidth, Converter={StaticResource ScaleValueConverter}, ConverterParameter=0.88}" ToolTip="{Binding}" ToolTipOpening="LibraryToolTipOpening" />
<StackPanel.ContextMenu>
<ContextMenu>
<MenuItem Header="{x:Static Loc:Labels.MainContextAdd}" Click="AddSelected"/>
<MenuItem Header="{x:Static Loc:Labels.MainContextOpenFile}" Click="OpenFile2"/>
<MenuItem Header="{x:Static Loc:Labels.MainContextOpenLocation}" Click="OpenLocation2"/>
<MenuItem Header="{x:Static Loc:Labels.MainContextDeleteFile}" Click="DeleteFile"/>
</ContextMenu>
</StackPanel.ContextMenu>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Button Name="AddBtn" HorizontalAlignment="Left" Margin="12,0,0,12" Content="{x:Static Loc:Labels.MainBtnAdd}" VerticalAlignment="Bottom" MinWidth="75" Padding="2" Click="AddSelected" IsEnabled="False" />
</Grid>
<Button Name="Expander1" Click="Expander1_Click" Grid.RowSpan="2" Width="15" Height="30" VerticalAlignment="Center" HorizontalAlignment="Right" Visibility="Collapsed"><</Button>
<TextBlock Text="{x:Static Loc:Labels.MainHeaderOrder}" Height="28" HorizontalAlignment="Left" Margin="12,60,0,0" VerticalAlignment="Top" Grid.Column="1" Grid.Row="0" FontSize="20" Padding="0" />
<TextBlock Name="ScheduleName" Grid.Column="1" Grid.Row="0" Height="28" Margin="12,98,12,0" VerticalAlignment="Top" Padding="0"/>
<ListBox Name="ScheduleList" Grid.Column="1" Grid.RowSpan="2" Margin="12,128,12,46" KeyUp="ScheduleList_KeyUp" MouseDoubleClick="ScheduleList_MouseDoubleClick" PreviewMouseMove="DragDrop_MouseMove" AllowDrop="True" Drop="DragDrop_DropHandler" SelectionMode="Extended" SelectionChanged="ScheduleList_SelectionChanged">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=IsFound}" Value="false">
<Setter Property="Foreground" Value="Red" />
</DataTrigger>
</Style.Triggers>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=Name}" MinWidth="{Binding ElementName=ScheduleList, Path=ActualWidth, Converter={StaticResource ScaleValueConverter}, ConverterParameter=0.9}" />
<StackPanel.ContextMenu>
<ContextMenu>
<MenuItem Header="{x:Static Loc:Labels.MainContextOpenFile}" Click="OpenFile"/>
<MenuItem Header="{x:Static Loc:Labels.MainContextOpenLocation}" Click="OpenLocation"/>
<MenuItem Header="{x:Static Loc:Labels.MainContextRemove}" Click="RemoveFile"/>
<MenuItem Header="{x:Static Loc:Labels.MainContextDuplicate}" Click="DuplicateFile"/>
</ContextMenu>
</StackPanel.ContextMenu>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<ListView x:Name="LiveList" Grid.Column="1" Grid.Row="0" Margin="12,128,12,10" Visibility="Hidden" SelectionChanged="LiveList_SelectionChanged" SelectionMode="Single" AllowDrop="True" Drop="DragDrop_DropHandler" PreviewKeyDown="LiveList_KeyDown" PreviewMouseDoubleClick="LiveList_PreviewMouseDoubleClick">
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<!-- new styles also need to be added to HightlightRow -->
<EventSetter Event="MouseEnter" Handler="SlideListViewItem_MouseEnter" />
<EventSetter Event="PreviewMouseRightButtonDown" Handler="SlideListViewItem_MouseRightButtonDown" />
</Style>
</ListView.ItemContainerStyle>
<ListView.View>
<GridView>
<GridViewColumn Width="35" Header="{x:Static Loc:Labels.MainLabelLiveSlide}" DisplayMemberBinding="{Binding SlideIndex}" />
<GridViewColumn Header="{x:Static Loc:Labels.MainLabelLiveText}" DisplayMemberBinding="{Binding Text}" />
<GridViewColumn Header="{x:Static Loc:Labels.MainLabelLiveNotes}" DisplayMemberBinding="{Binding Comment}" />
<GridViewColumn Width="50" Header="{x:Static Loc:Labels.MainLabelLiveJump}">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding Path=JumpIndex}" Width="35" Height="17" FontSize="10" Padding="0" ToolTip="{x:Static Loc:Labels.MainTooltipJumpText}" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Width="25">
<GridViewColumn.CellTemplate>
<DataTemplate>
<Button Height="17" Content=" " Click="HightlightRow" ToolTip="{x:Static Loc:Labels.MainTooltipHighlightBtn}" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
<ListView.ContextMenu>
<ContextMenu>
<MenuItem Header="{x:Static Loc:Labels.MainLabelLiveEdit}" Click="EditPres"/>
</ContextMenu>
</ListView.ContextMenu>
</ListView>
<GridSplitter Name="GridSplitter1" ResizeDirection="Rows" Height="2" VerticalAlignment="Top" Margin="12,0,12,0" Grid.Column="1" Grid.Row="1" HorizontalAlignment="Stretch" LayoutUpdated="GridSplitter_LayoutUpdated" Visibility="Hidden" Background="#828790" />
<GridSplitter Name="GridSplitter2" ResizeDirection="Columns" Width="2" HorizontalAlignment="Left" Margin="0,128,0,45" Grid.Column="2" Grid.RowSpan="2" VerticalAlignment="Stretch" LayoutUpdated="GridSplitter_LayoutUpdated" Visibility="Hidden" Background="#828790" />
<StackPanel Name="PreviewPanel" Grid.Column="1" Grid.Row="1" MaxHeight="250" Margin="12,10,0,45" VerticalAlignment="Bottom" Orientation="Horizontal" Visibility="Hidden">
<Border Name="PreviewImage" BorderBrush="Black" Margin="0,0,20,0" Width="333" Height="250" />
<Border Name="CurrentImage" BorderBrush="Black" Width="333" Height="250" />
<StackPanel Name="VideoPanel" Visibility="Collapsed">
<Rectangle Name="VideoDisplay" Width="333" Height="220" Visibility="Hidden">
<Rectangle.Fill>
<DrawingBrush>
<DrawingBrush.Drawing>
<VideoDrawing>
<VideoDrawing.Player>
<MediaPlayer x:Name="VideoPlayer" MediaOpened="Element_MediaOpened" MediaEnded="StopMedia" Balance="0" Clock="{x:Null}" IsMuted="False" Position="00:00:00" ScrubbingEnabled="False" SpeedRatio="1" Volume="0.5" />
</VideoDrawing.Player>
<VideoDrawing.Rect>
<Rect Width="333" Height="220" />
</VideoDrawing.Rect>
</VideoDrawing>
</DrawingBrush.Drawing>
</DrawingBrush>
</Rectangle.Fill>
</Rectangle>
<WrapPanel Name="MediaControls" HorizontalAlignment="Center" VerticalAlignment="Bottom" Orientation="Horizontal">
<Button Name="PlayPauseBtn" Click="PlayMedia" Content="{x:Static Loc:Labels.MainBtnVideoPlay}" Margin="0,5,5,0" />
<Button Click="StopMedia" Content="{x:Static Loc:Labels.MainBtnVideoStop}" Margin="0,5,5,0" />
<TextBlock VerticalAlignment="Center" Text="{x:Static Loc:Labels.MainBtnVideoVolume}" Margin="0,5,0,0" />
<Slider Name="volumeSlider" VerticalAlignment="Center" ValueChanged="ChangeMediaVolume" Minimum="0" Maximum="1" Value="0.5" Width="50" Margin="0,5,0,0"/>
<TextBlock VerticalAlignment="Center" Text="{x:Static Loc:Labels.MainBtnVideoSeek}" Margin="0,5,0,0" />
<TextBox Name="currentTime" Width="30" VerticalAlignment="Center" GotFocus="currentTime_GotFocus" LostFocus="currentTime_LostFocus" KeyDown="currentTime_KeyDown" Margin="0,5,0,0" />
<Slider Name="timelineSlider" VerticalAlignment="Center" PreviewMouseLeftButtonDown="timelineSlider_PreviewMouseLeftButtonDown" ValueChanged="timelineSlider_ValueChanged" PreviewMouseLeftButtonUp="SeekToMediaPosition" Width="60" Margin="0,5,0,0" />
<TextBlock Name="totalTime" VerticalAlignment="Center" Margin="0,5,0,0" />
</WrapPanel>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" HorizontalAlignment="Left" Grid.Column="1" Grid.Row="1" Margin="12">
<Button Name="StartBtn" Content="{x:Static Loc:Labels.MainBtnStart}" Padding="2" MinWidth="75" Margin="0,0,12,0" Click="Start_Click" />
<Button Name="StopBtn" Content="{x:Static Loc:Labels.MainBtnStop}" Padding="2" MinWidth="75" Margin="0,0,12,0" Click="Stop_Click" Visibility="Collapsed" />
<Button Name="TimerBtn" Content="{x:Static Loc:Labels.MainBtnTimer}" Padding="2" MinWidth="75" Margin="0,0,12,0" Click="TimerStart_Click" Visibility="Collapsed" ToolTip="{x:Static Loc:Labels.MainTooltipTimer}" />
<TextBox Name="Interval" Padding="2" Margin="0,0,12,0" Width="35" Visibility="Collapsed" TextChanged="Interval_TextChanged" ToolTip="{x:Static Loc:Labels.MainTooltipTimerSec}" />
<CheckBox Name="UseSlideTimings" Content="{x:Static Loc:Labels.MainChkbxUseTimings}" ToolTip="{x:Static Loc:Labels.MainTooltipUseTimings}" Checked="UseSlideTimingsChanged" Unchecked="UseSlideTimingsChanged" VerticalAlignment="Center" Visibility="Collapsed" />
</StackPanel>
<StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" HorizontalAlignment="Right" Grid.Column="1" Grid.Row="1" Margin="12">
<Button Name="RemoveBtn" Content="{x:Static Loc:Labels.MainBtnRemove}" Padding="2" MinWidth="75" Margin="12,0,0,0" Click="RemoveFile" IsEnabled="False" />
<Button Name="PrevBtn" Content="{x:Static Loc:Labels.MainBtnMoveUp}" Padding="2" MinWidth="75" Margin="12,0,0,0" Click="Up_Click" IsEnabled="False" />
<Button Name="NextBtn" Content="{x:Static Loc:Labels.MainBtnMoveDown}" Padding="2" MinWidth="75" Margin="12,0,0,0" Click="Down_Click" IsEnabled="False" />
</StackPanel>
<Grid Name="RemotePanel" Grid.ColumnSpan="3" Grid.RowSpan="2" Width="170" VerticalAlignment="Center" Height="350" HorizontalAlignment="Center" Visibility="Hidden" PreviewMouseLeftButtonDown="Down_Click" PreviewMouseRightButtonDown="Up_Click">
<Rectangle Fill="White" Stroke="Black" StrokeDashCap="Square" StrokeThickness="2" />
<TextBlock Text="{x:Static Loc:Labels.MainDescRemote}" Padding="10" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" />
</Grid>
</Grid>
</Window>