-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
87 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<ContentDialog | ||
x:Class="ReiTunes.Views.LibraryItemInfo" | ||
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:local="using:ReiTunes.Views" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
Title="{x:Bind _item.Name}" | ||
DefaultButton="Secondary" | ||
IsPrimaryButtonEnabled="False" | ||
SecondaryButtonClick="ContentDialog_SecondaryButtonClick" | ||
SecondaryButtonText="Cool" | ||
mc:Ignorable="d"> | ||
|
||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="*" /> | ||
</Grid.RowDefinitions> | ||
<TextBlock Text="{x:Bind _item.Name}" /> | ||
|
||
<ListView x:Name="BookmarksView" Grid.Row="1"> | ||
<ListView.ItemContainerTransitions> | ||
<TransitionCollection /> | ||
</ListView.ItemContainerTransitions> | ||
<ListView.ItemTemplate> | ||
<DataTemplate> | ||
<TextBlock Text="{Binding Position}" TextWrapping="Wrap" /> | ||
</DataTemplate> | ||
</ListView.ItemTemplate> | ||
</ListView> | ||
</Grid> | ||
</ContentDialog> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using ReiTunes.Configuration; | ||
using ReiTunes.Core; | ||
using Windows.UI.Xaml.Controls; | ||
|
||
// The Content Dialog item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238 | ||
|
||
namespace ReiTunes.Views { | ||
|
||
public sealed partial class LibraryItemInfo : ContentDialog { | ||
private readonly LibraryItem _item; | ||
private PlayerViewModel _viewModel; | ||
|
||
public LibraryItemInfo(LibraryItem item) { | ||
this.InitializeComponent(); | ||
_item = item; | ||
|
||
foreach (var bookmark in _item.Bookmarks) { | ||
BookmarksView.Items.Add(bookmark); | ||
} | ||
|
||
_viewModel = ServiceLocator.Current.GetService<PlayerViewModel>(); | ||
} | ||
|
||
private void ContentDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { | ||
var selected = BookmarksView.SelectedItem as Bookmark; | ||
|
||
if (selected != null) { | ||
if (_viewModel.CurrentlyPlayingItem == _item) { | ||
_viewModel.MediaPlayer.PlaybackSession.Position = selected.Position; | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters