Skip to content

Commit 784b2d8

Browse files
committed
1.3.0 First basic bookmarks UI!!!
1 parent 6cbe291 commit 784b2d8

6 files changed

+87
-3
lines changed

ReiTunes/Package.appxmanifest

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<Identity
1212
Name="2b3c53fd-b804-4e1e-b26c-cae302ea1108"
1313
Publisher="CN=Reilly Wood"
14-
Version="1.2.7.0" />
14+
Version="1.3.0.0" />
1515

1616
<mp:PhoneIdentity PhoneProductId="2b3c53fd-b804-4e1e-b26c-cae302ea1108" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
1717

ReiTunes/ReiTunes.csproj

+7
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@
153153
<Compile Include="Services\WhatsNewDisplayService.cs" />
154154
<Compile Include="ViewModels\PlayerViewModel.cs" />
155155
<Compile Include="FileReader.cs" />
156+
<Compile Include="Views\LibraryItemInfo.xaml.cs">
157+
<DependentUpon>LibraryItemInfo.xaml</DependentUpon>
158+
</Compile>
156159
<Compile Include="Views\Player.xaml.cs">
157160
<DependentUpon>Player.xaml</DependentUpon>
158161
</Compile>
@@ -233,6 +236,10 @@
233236
<Generator>MSBuild:Compile</Generator>
234237
<SubType>Designer</SubType>
235238
</Page>
239+
<Page Include="Views\LibraryItemInfo.xaml">
240+
<SubType>Designer</SubType>
241+
<Generator>MSBuild:Compile</Generator>
242+
</Page>
236243
<Page Include="Views\Player.xaml">
237244
<Generator>MSBuild:Compile</Generator>
238245
<SubType>Designer</SubType>

ReiTunes/Views/LibraryItemInfo.xaml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<ContentDialog
2+
x:Class="ReiTunes.Views.LibraryItemInfo"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:local="using:ReiTunes.Views"
7+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
8+
Title="{x:Bind _item.Name}"
9+
DefaultButton="Secondary"
10+
IsPrimaryButtonEnabled="False"
11+
SecondaryButtonClick="ContentDialog_SecondaryButtonClick"
12+
SecondaryButtonText="Cool"
13+
mc:Ignorable="d">
14+
15+
<Grid>
16+
<Grid.RowDefinitions>
17+
<RowDefinition Height="Auto" />
18+
<RowDefinition Height="*" />
19+
</Grid.RowDefinitions>
20+
<TextBlock Text="{x:Bind _item.Name}" />
21+
22+
<ListView x:Name="BookmarksView" Grid.Row="1">
23+
<ListView.ItemContainerTransitions>
24+
<TransitionCollection />
25+
</ListView.ItemContainerTransitions>
26+
<ListView.ItemTemplate>
27+
<DataTemplate>
28+
<TextBlock Text="{Binding Position}" TextWrapping="Wrap" />
29+
</DataTemplate>
30+
</ListView.ItemTemplate>
31+
</ListView>
32+
</Grid>
33+
</ContentDialog>
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using ReiTunes.Configuration;
2+
using ReiTunes.Core;
3+
using Windows.UI.Xaml.Controls;
4+
5+
// The Content Dialog item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
6+
7+
namespace ReiTunes.Views {
8+
9+
public sealed partial class LibraryItemInfo : ContentDialog {
10+
private readonly LibraryItem _item;
11+
private PlayerViewModel _viewModel;
12+
13+
public LibraryItemInfo(LibraryItem item) {
14+
this.InitializeComponent();
15+
_item = item;
16+
17+
foreach (var bookmark in _item.Bookmarks) {
18+
BookmarksView.Items.Add(bookmark);
19+
}
20+
21+
_viewModel = ServiceLocator.Current.GetService<PlayerViewModel>();
22+
}
23+
24+
private void ContentDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) {
25+
var selected = BookmarksView.SelectedItem as Bookmark;
26+
27+
if (selected != null) {
28+
if (_viewModel.CurrentlyPlayingItem == _item) {
29+
_viewModel.MediaPlayer.PlaybackSession.Position = selected.Position;
30+
}
31+
}
32+
}
33+
}
34+
}

ReiTunes/Views/Player.xaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,9 @@
287287
Text="Copy URL" />
288288
<MenuFlyoutItem
289289
x:Name="WorldMenuItem"
290-
Click="ShowRecentEvents"
291-
Text="Show recent events (WIP)" />
290+
Click="ShowItemInfo"
291+
Icon="Zoom"
292+
Text="Show Info" />
292293
<MenuFlyoutItem
293294
x:Name="DeleteMenuItem"
294295
Click="DeleteMenuItem_Click"

ReiTunes/Views/Player.xaml.cs

+9
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,15 @@ private void libraryDataGrid_Sorting(object sender, Microsoft.Toolkit.Uwp.UI.Con
362362
//}
363363
}
364364

365+
private async void ShowItemInfo(object sender, RoutedEventArgs e) {
366+
var item = (sender as FrameworkElement).DataContext as LibraryItem;
367+
368+
if (item != null) {
369+
var dialog = new LibraryItemInfo(item);
370+
await dialog.ShowAsync();
371+
}
372+
}
373+
365374
private async void ShowRecentEvents(object sender, RoutedEventArgs e) {
366375
var recentEventsDialog = new RecentEventsContentDialog(ViewModel.GetRecentEvents());
367376
await recentEventsDialog.ShowAsync();

0 commit comments

Comments
 (0)