-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathSessionViewer.xaml
145 lines (134 loc) · 7.28 KB
/
SessionViewer.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
<!--
Copyright (c) Microsoft Corporation. All rights reserved.
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<Page
x:Class="AnnotatedAudio.View.SessionViewer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:AnnotatedAudio.View"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:m="using:AnnotatedAudio.Model"
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
mc:Ignorable="d">
<Page.Resources>
<DataTemplate x:Key="HamburgerMenuItem" x:DataType="m:SessionPage">
<Grid Width="240" Height="48">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="48" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<FontIcon Grid.Column="0"
Margin="12,12,11,12"
FontFamily="Segoe MDL2 Assets"
Glyph=""
Foreground="{ThemeResource ApplicationForegroundThemeBrush}" />
<TextBlock Grid.Column="1"
Text="{x:Bind PageName}"
Foreground="{ThemeResource ApplicationForegroundThemeBrush}"
FontSize="16"
VerticalAlignment="Center" />
</Grid>
</DataTemplate>
<DataTemplate x:Key="HamburgerMenuImageItem" x:DataType="m:OptionItem">
<Grid Width="240" Height="48" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="48" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<SymbolIcon Grid.Column="0"
Margin="12,12,11,12"
Symbol="{x:Bind Icon}"
Foreground="{ThemeResource ApplicationForegroundThemeBrush}" />
<TextBlock Grid.Column="1"
Text="{x:Bind Name}"
Foreground="{ThemeResource ApplicationForegroundThemeBrush}"
FontSize="16"
VerticalAlignment="Center" />
</Grid>
</DataTemplate>
</Page.Resources>
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<controls:HamburgerMenu PaneBackground="{ThemeResource ApplicationPageBackgroundThemeBrush}" x:Name="HamburgerMenu"
Foreground="{ThemeResource ApplicationForegroundThemeBrush}"
ItemTemplate="{StaticResource HamburgerMenuItem}"
OptionsItemTemplate="{StaticResource HamburgerMenuImageItem}"
OptionsItemClick="HamburgerMenu_OptionsItemClick"
OpenPaneLength="240"
DisplayMode="CompactOverlay"
CompactPaneLength="48"
HamburgerHeight="48"
IsPaneOpen="False"
ItemClick="HamburgerMenu_ItemClick"
SelectedItem="{x:Bind ViewModel.CurrentPage}"
ItemsSource="{x:Bind ViewModel.Pages}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Border Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Grid.Row="0">
<controls:HeaderedTextBlock
HorizontalAlignment="Center"
Header="{x:Bind ViewModel.SessionPicker.SelectedSession.Name}"
Text="{x:Bind ViewModel.RecordingManager.CurrentTrackRecordingTimeFormatted, Mode=OneWay}"
Orientation="Vertical"
Margin="20,10,0,0" />
</Border>
<InkCanvas x:Name="ink" Grid.Row="1" Margin="10,10,77,82" />
<InkToolbar
x:Name="inkSettings"
VerticalAlignment="Bottom"
HorizontalAlignment="Right"
TargetInkCanvas="{x:Bind ink}"
/>
</Grid>
</controls:HamburgerMenu>
<CommandBar VerticalAlignment="Bottom" ClosedDisplayMode="Compact">
<AppBarButton Label="Record" Command="{x:Bind ViewModel.Record}">
<AppBarButton.Icon>
<FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" Foreground="{x:Bind ViewModel.RecordingButtonForeground, Mode=OneWay}" />
</AppBarButton.Icon>
</AppBarButton>
<AppBarButton Icon="Stop" Label="Stop Recording" Command="{x:Bind ViewModel.Stop}" />
<CommandBar.Content>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<MediaPlayerElement x:Name="mediaPlayerElement"
AreTransportControlsEnabled="True"
Width="400"
Visibility="{x:Bind ViewModel.PlaybackManager.MediaPlayerVisibility}"
Background="Black"
Foreground="Black">
<MediaPlayerElement.TransportControls>
<MediaTransportControls
IsPreviousTrackButtonVisible="True"
IsNextTrackButtonVisible="True"
IsVolumeButtonVisible="False"
IsPlaybackRateButtonVisible="False"
IsZoomButtonVisible="False"
IsFullWindowButtonVisible="False"
IsCompact="True"
/>
</MediaPlayerElement.TransportControls>
</MediaPlayerElement>
</StackPanel>
</CommandBar.Content>
</CommandBar>
</Grid>
</Page>