Commit 5c0c519d authored by Axelander's avatar Axelander

Merge branch 'issue_current_bugs' into 'develop'

Merge bug fixings into develop

See merge request !3
parents 05b63517 db74b617
### 2.4 Build xxxx (2017-xx-xx)
* [New]: MusicBrainz Support
* [New]: Settings Page shows now the size of the local track cache
* [New]: Added links on Settings Page for license and gitlab repo
* [Changed]: Modified and extended views with artist info
* [Fixed]: Data loss while getting metadata of current track in playback
* [Fixed]: Page title on detailed album view
* [Fixed]: Newest album ordering on HomePage for mobile devices
* [Fixed]: Missing Cover in System Media Transport Controls (SMTC)
### 2.3 Build 6239 (2017-01-30)
......
......@@ -12,6 +12,7 @@ using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
using SonicStreamer.Common.System;
namespace SonicStreamer
{
......@@ -77,7 +78,7 @@ namespace SonicStreamer
if (previousExecutionState == ApplicationExecutionState.Terminated)
{
var loginVm = Current.Resources["LoginVM"] as LoginViewModel;
var loginVm = Current.Resources[Constants.ViewModelLogin] as LoginViewModel;
if (loginVm != null)
{
loginVm.RestoreData();
......
......@@ -7,6 +7,7 @@ using System.Threading.Tasks;
using Windows.Media;
using Windows.Media.Playback;
using Windows.Storage;
using Windows.Storage.Streams;
namespace SonicStreamer.Common.System
{
......@@ -51,6 +52,9 @@ namespace SonicStreamer.Common.System
displayProperties.MusicProperties.Title = playableObject.Name;
displayProperties.MusicProperties.Artist = playableObject.Artist;
displayProperties.MusicProperties.AlbumTitle = playableObject.Album;
displayProperties.Thumbnail = (playableObject.Cover != null)
? RandomAccessStreamReference.CreateFromUri(new Uri(playableObject.Cover.Uri))
: null;
var track = playableObject as Track;
if (track != null)
{
......
<UserControl
x:Class="SonicStreamer.Controls.AddToPlaylistDialog"
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"
d:DesignHeight="300"
d:DesignWidth="400"
mc:Ignorable="d">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ms-appx:///Styles/TextBlockStyles.xaml" />
<ResourceDictionary Source="ms-appx:///Styles/TextBoxStyles.xaml" />
<ResourceDictionary Source="ms-appx:///Styles/ButtonStyles.xaml" />
<ResourceDictionary Source="ms-appx:///Styles/ComboBoxStyles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<StackPanel DataContext="{StaticResource PlaylistVM}">
<ComboBox
Margin="0,0,0,5"
HorizontalAlignment="Stretch"
ItemsSource="{Binding AvailablePlaylists}"
PlaceholderText="Select a playlist"
SelectionChanged="{x:Bind PlaylistVm.AddToPlaylistComboBox_SelectionChanged}"
Style="{StaticResource OrangeComboBoxStyle}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}" />
</DataTemplate>
</ComboBox.ItemTemplate>
<ComboBox.ItemContainerStyle>
<Style BasedOn="{StaticResource OrangeComboBoxItemStyle}" TargetType="ComboBoxItem" />
</ComboBox.ItemContainerStyle>
</ComboBox>
<TextBox
PlaceholderText="New Playlist Name"
Style="{StaticResource OrangeTextBoxStyle}"
Text="{Binding NewPlaylistName, Mode=TwoWay}"
Visibility="{Binding IsNewPlaylistTextBoxVisible, Converter={StaticResource BooleanToVisibilityConverter}}" />
</StackPanel>
</Grid>
</UserControl>
using Windows.UI.Xaml.Controls;
using SonicStreamer.Common.System;
using SonicStreamer.ViewModels;
using System.Threading.Tasks;
namespace SonicStreamer.Controls
{
public sealed partial class AddToPlaylistDialog : UserControl
{
public readonly PlaylistViewModel PlaylistVm;
public AddToPlaylistDialog()
{
this.InitializeComponent();
if (ResourceLoader.Current.GetResource(ref PlaylistVm, Constants.ViewModelPlaylist) == false)
PlaylistVm = new PlaylistViewModel();
}
}
}
This diff is collapsed.
using Windows.UI.Xaml.Controls;
using SonicStreamer.Common.System;
using SonicStreamer.ViewModels;
namespace SonicStreamer.Controls
{
public sealed partial class ArtistInfoView : UserControl
{
public TrackListingViewModel TrackListingVm;
public ArtistInfoView()
{
InitializeComponent();
if (ResourceLoader.Current.GetResource(ref TrackListingVm, Constants.ViewModelTrackListing) == false)
TrackListingVm = new TrackListingViewModel();
}
}
}
\ No newline at end of file
......@@ -2,15 +2,12 @@
x:Class="SonicStreamer.Controls.MobilePlaybackView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:SonicStreamer.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:Core="using:Microsoft.Xaml.Interactions.Core"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="400"
DataContext="{StaticResource PlaybackVM}">
DataContext="{StaticResource PlaybackVM}"
mc:Ignorable="d">
<UserControl.Resources>
<ResourceDictionary>
......@@ -35,13 +32,18 @@
</Grid.RowDefinitions>
<Grid Margin="0,0,0,5">
<Image Source="ms-appx:///Assets/cover.png" />
<Image Source="{Binding CurrentTrack.Cover.Uri}" Canvas.ZIndex="1" />
<Image Canvas.ZIndex="1" Source="{Binding CurrentTrack.Cover.Uri}" />
</Grid>
<StackPanel Grid.Row="1">
<TextBlock Text="{Binding CurrentTrack.Name}" Style="{StaticResource OrangeTitleTextBlockStyle}"
FontWeight="SemiBold" TextAlignment="Center" />
<TextBlock Text="{Binding CurrentTrack.Artist}" Style="{StaticResource OrangeSubtitleTextBlockStyle}"
TextAlignment="Center" />
<TextBlock
FontWeight="SemiBold"
Style="{StaticResource OrangeTitleTextBlockStyle}"
Text="{Binding CurrentTrack.Name}"
TextAlignment="Center" />
<TextBlock
Style="{StaticResource OrangeSubtitleTextBlockStyle}"
Text="{Binding CurrentTrack.Artist}"
TextAlignment="Center" />
</StackPanel>
</Grid>
<Grid Grid.Row="1" VerticalAlignment="Center">
......@@ -55,80 +57,63 @@
</Grid.RowDefinitions>
<Slider
Grid.ColumnSpan="2"
IsEnabled="{Binding PlaybackEnabled}"
Maximum="{Binding CurrentTrackDuration}"
Value="{Binding CurrentTrackPosition, Mode=TwoWay}"
IsThumbToolTipEnabled="False"
Style="{StaticResource OrangeSliderStyle}">
<Interactivity:Interaction.Behaviors>
<Core:EventTriggerBehavior EventName="PointerCaptureLost">
<Core:CallMethodAction TargetObject="{Binding Mode=OneWay}"
MethodName="PlaybackSlider_PointerCaptureLost" />
</Core:EventTriggerBehavior>
<Core:EventTriggerBehavior EventName="PointerEntered">
<Core:CallMethodAction TargetObject="{Binding Mode=OneWay}"
MethodName="PlaybackSlider_PointerEntered" />
</Core:EventTriggerBehavior>
<Core:EventTriggerBehavior EventName="PointerExited">
<Core:CallMethodAction TargetObject="{Binding Mode=OneWay}"
MethodName="PlaybackSlider_PointerExited" />
</Core:EventTriggerBehavior>
</Interactivity:Interaction.Behaviors>
</Slider>
<TextBlock Grid.Row="1" Text="{Binding PlayedDuration}"
Style="{StaticResource OrangeCaptionTextBlockStyle}" />
<TextBlock Grid.Column="1" Grid.Row="1" Text="{Binding RemainingDuration}"
Style="{StaticResource OrangeCaptionTextBlockStyle}" HorizontalAlignment="Right" />
Maximum="{Binding CurrentTrackDuration}"
PointerCaptureLost="{x:Bind PlaybackVm.PlaybackSlider_PointerCaptureLost}"
PointerEntered="{x:Bind PlaybackVm.PlaybackSlider_PointerEntered}"
PointerExited="{x:Bind PlaybackVm.PlaybackSlider_PointerExited}"
Style="{StaticResource OrangeSliderStyle}"
Value="{Binding CurrentTrackPosition, Mode=TwoWay}" />
<TextBlock
Grid.Row="1"
Grid.Column="0"
Style="{StaticResource OrangeCaptionTextBlockStyle}"
Text="{Binding PlayedDuration}" />
<TextBlock
Grid.Row="1"
Grid.Column="1"
HorizontalAlignment="Right"
Style="{StaticResource OrangeCaptionTextBlockStyle}"
Text="{Binding RemainingDuration}" />
</Grid>
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" Margin="5">
<ToggleButton Background="Transparent" Style="{StaticResource PlaybackToggleButtonStyle}"
IsChecked="{Binding IsRepeating, Mode=TwoWay}">
<Interactivity:Interaction.Behaviors>
<Core:EventTriggerBehavior EventName="Checked">
<Core:CallMethodAction TargetObject="{Binding Mode=OneWay}" MethodName="SwitchOnRepeatingMode" />
</Core:EventTriggerBehavior>
<Core:EventTriggerBehavior EventName="Unchecked">
<Core:CallMethodAction TargetObject="{Binding Mode=OneWay}" MethodName="SwitchOffRepeatingMode" />
</Core:EventTriggerBehavior>
</Interactivity:Interaction.Behaviors>
<StackPanel
Grid.Row="2"
Margin="5"
HorizontalAlignment="Center"
Orientation="Horizontal">
<ToggleButton
Checked="{x:Bind PlaybackVm.SwitchOnRepeatingMode}"
IsChecked="{Binding IsRepeating, Mode=TwoWay}"
Style="{StaticResource PlaybackToggleButtonStyle}"
Unchecked="{x:Bind PlaybackVm.SwitchOffRepeatingMode}">
<SymbolIcon Symbol="RepeatAll" />
</ToggleButton>
<Line Y1="40" Stroke="Orange" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="5,0" />
<Button IsEnabled="{Binding PlaybackEnabled}" Style="{StaticResource PlaybackButtonStyle}">
<Interactivity:Interaction.Behaviors>
<Core:EventTriggerBehavior EventName="Click">
<Core:CallMethodAction TargetObject="{Binding Mode=OneWay}" MethodName="PlayPrevious" />
</Core:EventTriggerBehavior>
</Interactivity:Interaction.Behaviors>
<Line
Margin="5,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Stroke="Orange"
Y1="40" />
<Button Click="{x:Bind PlaybackVm.PlayPrevious}" Style="{StaticResource PlaybackButtonStyle}">
<SymbolIcon Symbol="Previous" />
</Button>
<Button IsEnabled="{Binding PlaybackEnabled}" Style="{StaticResource PlaybackButtonStyle}">
<Interactivity:Interaction.Behaviors>
<Core:EventTriggerBehavior EventName="Click">
<Core:CallMethodAction TargetObject="{Binding Mode=OneWay}" MethodName="Play" />
</Core:EventTriggerBehavior>
</Interactivity:Interaction.Behaviors>
<Button Click="{x:Bind PlaybackVm.Play}" Style="{StaticResource PlaybackButtonStyle}">
<SymbolIcon Symbol="{Binding PlayButtonIcon}" />
</Button>
<Button IsEnabled="{Binding PlaybackEnabled}" Style="{StaticResource PlaybackButtonStyle}">
<Interactivity:Interaction.Behaviors>
<Core:EventTriggerBehavior EventName="Click">
<Core:CallMethodAction TargetObject="{Binding Mode=OneWay}" MethodName="PlayNext" />
</Core:EventTriggerBehavior>
</Interactivity:Interaction.Behaviors>
<Button Click="{x:Bind PlaybackVm.PlayNext}" Style="{StaticResource PlaybackButtonStyle}">
<SymbolIcon Symbol="Next" />
</Button>
<Line Y1="40" Stroke="Orange" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="5,0" />
<ToggleButton Background="Transparent" Style="{StaticResource PlaybackToggleButtonStyle}"
IsChecked="{Binding IsShuffling, Mode=TwoWay}">
<Interactivity:Interaction.Behaviors>
<Core:EventTriggerBehavior EventName="Checked">
<Core:CallMethodAction TargetObject="{Binding Mode=OneWay}" MethodName="SwitchOnShuffleMode" />
</Core:EventTriggerBehavior>
<Core:EventTriggerBehavior EventName="Unchecked">
<Core:CallMethodAction TargetObject="{Binding Mode=OneWay}" MethodName="SwitchOffShuffleMode" />
</Core:EventTriggerBehavior>
</Interactivity:Interaction.Behaviors>
<Line
Margin="5,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Stroke="Orange"
Y1="40" />
<ToggleButton
Checked="{x:Bind PlaybackVm.SwitchOnShuffleMode}"
IsChecked="{Binding IsShuffling, Mode=TwoWay}"
Style="{StaticResource PlaybackToggleButtonStyle}"
Unchecked="{x:Bind PlaybackVm.SwitchOffShuffleMode}">
<SymbolIcon Symbol="Shuffle" />
</ToggleButton>
</StackPanel>
......
using Windows.UI.Xaml.Controls;
using SonicStreamer.Common.System;
using SonicStreamer.ViewModels;
namespace SonicStreamer.Controls
{
public sealed partial class MobilePlaybackView : UserControl
{
public PlaybackViewModel PlaybackVm;
public MobilePlaybackView()
{
InitializeComponent();
if (ResourceLoader.Current.GetResource(ref PlaybackVm, Constants.ViewModelPlayback) == false)
PlaybackVm = new PlaybackViewModel();
}
}
}
\ No newline at end of file
......@@ -2,17 +2,12 @@
x:Class="SonicStreamer.Controls.SimilarArtistsView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:SonicStreamer.Controls"
xmlns:common="using:SonicStreamer.Common"
xmlns:controls="using:SonicStreamer.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:Core="using:Microsoft.Xaml.Interactions.Core"
mc:Ignorable="d"
d:DataContext="{StaticResource TrackListingVM}"
d:DesignHeight="600"
d:DesignWidth="1020"
d:DataContext="{StaticResource TrackListingVM}">
mc:Ignorable="d">
<UserControl.Resources>
<ResourceDictionary>
......@@ -22,12 +17,13 @@
<ResourceDictionary Source="ms-appx:///Styles/ListingItemStyles.xaml" />
<ResourceDictionary Source="ms-appx:///Styles/ButtonStyles.xaml" />
</ResourceDictionary.MergedDictionaries>
<common:BooleanToVisibilityConverter x:Key="BoolToVis" />
<Style x:Key="SectionGridStyle" TargetType="Grid">
<Setter Property="Margin" Value="0,10,20,0" />
</Style>
<Style x:Key="InfoSectionHeaderTextBlockStyle" TargetType="TextBlock"
BasedOn="{StaticResource OrangeSubtitleTextBlockStyle}">
<Style
x:Key="InfoSectionHeaderTextBlockStyle"
BasedOn="{StaticResource OrangeSubtitleTextBlockStyle}"
TargetType="TextBlock">
<Setter Property="FontWeight" Value="SemiBold" />
<Setter Property="FontStyle" Value="Italic" />
<Setter Property="Margin" Value="0,10" />
......@@ -35,24 +31,24 @@
</ResourceDictionary>
</UserControl.Resources>
<ScrollViewer HorizontalScrollMode="Disabled" HorizontalSnapPointsType="None" IsHorizontalRailEnabled="False"
IsHorizontalScrollChainingEnabled="False">
<ScrollViewer
HorizontalScrollMode="Disabled"
HorizontalSnapPointsType="None"
IsHorizontalRailEnabled="False"
IsHorizontalScrollChainingEnabled="False">
<StackPanel d:DataContext="{Binding ArtistInfo}" Orientation="Vertical">
<!--Subsonic-->
<!-- Subsonic -->
<Grid Style="{StaticResource SectionGridStyle}">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock Text="Available on server" Style="{StaticResource InfoSectionHeaderTextBlockStyle}" />
<TextBlock Style="{StaticResource InfoSectionHeaderTextBlockStyle}" Text="Available on server" />
<ListView
Grid.Row="1"
ItemClick="SubsonicSimilarArtist_ItemClick"
ItemsSource="{Binding SubsonicSimilarArtists}"
ItemTemplate="{StaticResource ListingItemTemplate}"
Style="{StaticResource ListingListViewStyle}"
IsItemClickEnabled="True"
SelectionMode="None"
ItemClick="SubsonicSimilarArtist_ItemClick">
Style="{StaticResource ListingListViewStyle}">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<ItemsWrapGrid Orientation="Horizontal" />
......@@ -60,35 +56,34 @@
</ListView.ItemsPanel>
</ListView>
</Grid>
<!--last.fm-->
<!-- last.fm -->
<Grid Style="{StaticResource SectionGridStyle}">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock Text="Suggestions from last.fm" Style="{StaticResource InfoSectionHeaderTextBlockStyle}" />
<TextBlock Style="{StaticResource InfoSectionHeaderTextBlockStyle}" Text="Suggestions from last.fm" />
<ListView
Grid.Row="1"
HorizontalAlignment="Center"
IsItemClickEnabled="True"
SelectionMode="None"
ItemsSource="{Binding LastFmSimilarArtists}">
<Interactivity:Interaction.Behaviors>
<Core:EventTriggerBehavior EventName="ItemClick">
<Core:CallMethodAction TargetObject="{Binding Mode=OneWay}" MethodName="SimilarArtistClick" />
</Core:EventTriggerBehavior>
</Interactivity:Interaction.Behaviors>
ItemClick="{x:Bind TrackListingVm.ArtistInfo.SimilarArtistClick}"
ItemsSource="{Binding LastFmSimilarArtists}"
SelectionMode="None">
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock
Text="{Binding Name}"
Style="{StaticResource OrangeBaseTextBlockStyle}"
Margin="0,0,0,10"
FontSize="25"
FontWeight="SemiBold"
TextWrapping="Wrap"
Margin="0,0,0,10" />
<Image Source="{Binding Cover.Uri}" Stretch="UniformToFill" MaxHeight="200" />
Style="{StaticResource OrangeBaseTextBlockStyle}"
Text="{Binding Name}"
TextWrapping="Wrap" />
<Image
MaxHeight="200"
Source="{Binding Cover.Uri}"
Stretch="UniformToFill" />
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
......
using SonicStreamer.Pages;
using Windows.UI.Xaml.Controls;
using SonicStreamer.Common.System;
using SonicStreamer.ViewModels;
namespace SonicStreamer.Controls
{
public sealed partial class SimilarArtistsView : UserControl
{
public TrackListingViewModel TrackListingVm;
public SimilarArtistsView()
{
InitializeComponent();
if (ResourceLoader.Current.GetResource(ref TrackListingVm, Constants.ViewModelTrackListing) == false)
TrackListingVm = new TrackListingViewModel();
}
private void SubsonicSimilarArtist_ItemClick(object sender, ItemClickEventArgs e)
......
......@@ -2,9 +2,7 @@
x:Class="SonicStreamer.Pages.AlbumsPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
DataContext="{Binding Source={StaticResource AlbumVM}}"
NavigationCacheMode="Required"
......@@ -37,77 +35,22 @@
<CommandBar.Resources>
<Style BasedOn="{StaticResource OrangeAppBarButtonStyle}" TargetType="AppBarButton" />
</CommandBar.Resources>
<AppBarButton Icon="Play" Label="Play Selection">
<interactivity:Interaction.Behaviors>
<core:EventTriggerBehavior EventName="Click">
<core:CallMethodAction MethodName="PlayClick" TargetObject="{Binding Mode=OneWay}" />
</core:EventTriggerBehavior>
</interactivity:Interaction.Behaviors>
</AppBarButton>
<AppBarButton Icon="Add" Label="Add to Playback">
<interactivity:Interaction.Behaviors>
<core:EventTriggerBehavior EventName="Click">
<core:CallMethodAction MethodName="AddClick" TargetObject="{Binding Mode=OneWay}" />
</core:EventTriggerBehavior>
</interactivity:Interaction.Behaviors>
</AppBarButton>
<AppBarButton Icon="Favorite" Label="Add to Playlist">
<AppBarButton.Flyout>
<Flyout
x:Name="PlaylistFlyout"
Closed="PlaylistFlyout_Closed"
Opening="PlaylistFlyout_Opening">
<StackPanel MinWidth="250" DataContext="{StaticResource PlaylistVM}">
<ComboBox
Margin="0,0,0,5"
HorizontalAlignment="Stretch"
ItemsSource="{Binding AvailablePlaylists}"
PlaceholderText="Select a playlist"
SelectedItem="{Binding SelectedAddToPlaylist, Mode=TwoWay}"
Style="{StaticResource OrangeComboBoxStyle}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}" />
</DataTemplate>
</ComboBox.ItemTemplate>
<ComboBox.ItemContainerStyle>
<Style BasedOn="{StaticResource OrangeComboBoxItemStyle}" TargetType="ComboBoxItem" />
</ComboBox.ItemContainerStyle>
<interactivity:Interaction.Behaviors>
<core:EventTriggerBehavior EventName="SelectionChanged">
<core:CallMethodAction MethodName="AddToPlaylistComboBox_SelectionChanged" TargetObject="{Binding Mode=OneWay}" />
</core:EventTriggerBehavior>
</interactivity:Interaction.Behaviors>
</ComboBox>
<TextBox
Margin="0,0,0,5"
PlaceholderText="New Playlist Name"
Style="{StaticResource OrangeTextBoxStyle}"
Text="{Binding NewPlaylistName, Mode=TwoWay}"
Visibility="{Binding IsNewPlaylistTextBoxVisible, Converter={StaticResource BooleanToVisibilityConverter}}" />
<Button
HorizontalAlignment="Center"
Click="AddToPlayback_Click"
Content="Add to Playlist"
IsEnabled="{Binding IsAddToPlaylistButtonEnabled}"
Style="{StaticResource OrangeButtonStyle}">
<interactivity:Interaction.Behaviors>
<core:EventTriggerBehavior EventName="Click">
<core:CallMethodAction MethodName="AddToPlaylistClick" TargetObject="{StaticResource AlbumVM}" />
</core:EventTriggerBehavior>
</interactivity:Interaction.Behaviors>
</Button>
</StackPanel>
</Flyout>
</AppBarButton.Flyout>
</AppBarButton>
<AppBarButton Icon="Download" Label="Download">
<interactivity:Interaction.Behaviors>
<core:EventTriggerBehavior EventName="Click">
<core:CallMethodAction MethodName="DownloadTracksClick" TargetObject="{Binding Mode=OneWay}" />
</core:EventTriggerBehavior>
</interactivity:Interaction.Behaviors>
</AppBarButton>
<AppBarButton
Click="{x:Bind AlbumVm.PlayClick}"
Icon="Play"
Label="Play Selection" />
<AppBarButton
Click="{x:Bind AlbumVm.AddClick}"
Icon="Add"
Label="Add to Playback" />
<AppBarButton
Click="AddToPlaylist_Click"
Icon="Favorite"
Label="Add to Playlist" />
<AppBarButton
Click="{x:Bind AlbumVm.DownloadTracksClick}"
Icon="Download"
Label="Download" />
</CommandBar>
</Page.BottomAppBar>
......@@ -116,7 +59,14 @@
<RowDefinition Height="48" />
<RowDefinition />
</Grid.RowDefinitions>
<Grid>
<ContentDialog
x:Name="AddToPlaylistDialog"
IsPrimaryButtonEnabled="True"
IsSecondaryButtonEnabled="True"
Opened="AddToPlaylistDialog_OnOpened"
PrimaryButtonText="Add To Playlist"
SecondaryButtonText="Cancel" />
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
......@@ -124,14 +74,9 @@
<StackPanel Orientation="Horizontal">
<RadioButton
x:Name="HamburgerButton"
Click="{x:Bind MainVm.HamburgerButtonClick}"
DataContext="{StaticResource MainVM}"
Style="{StaticResource SplitViewHamburgerButtonStyle}">
<interactivity:Interaction.Behaviors>
<core:EventTriggerBehavior EventName="Click">
<core:CallMethodAction MethodName="HamburgerButtonClick" TargetObject="{Binding Mode=OneWay}" />
</core:EventTriggerBehavior>
</interactivity:Interaction.Behaviors>
</RadioButton>
Style="{StaticResource SplitViewHamburgerButtonStyle}" />
<TextBlock Style="{StaticResource OrangePageHeaderTextBlockStyle}" Text="albums" />
</StackPanel>
<Grid Grid.Column="1" HorizontalAlignment="Right">
......@@ -155,15 +100,11 @@
IsItemClickEnabled="{Binding IsItemClickEnabled}"
ItemClick="listingItemsView_ItemClick"
ItemsSource="{Binding Source={StaticResource ListViewSource}}"
SelectionChanged="{x:Bind AlbumVm.ListingItems_SelectionChanged}"
SelectionMode="{Binding SelectionMode}">
<ListView.GroupStyle>
<GroupStyle HeaderTemplate="{StaticResource ListingGroupHeaderStyle}" />
</ListView.GroupStyle>
<interactivity:Interaction.Behaviors>
<core:EventTriggerBehavior EventName="SelectionChanged">
<core:CallMethodAction MethodName="ListingItems_SelectionChanged" TargetObject="{Binding Mode=OneWay}" />
</core:EventTriggerBehavior>
</interactivity:Interaction.Behaviors>
</ListView>
</SemanticZoom.ZoomedInView>
</SemanticZoom>
......
using SonicStreamer.Common.System;
using System;
using SonicStreamer.Common.System;
using SonicStreamer.ViewModels;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
using SonicStreamer.Controls;
namespace SonicStreamer.Pages
{
public sealed partial class AlbumsPage : Page
{
readonly AlbumViewModel _albumVm;
readonly PlaylistViewModel _playlistVm;
public readonly AlbumViewModel AlbumVm;
public readonly PlaylistViewModel PlaylistVm;
public readonly MainViewModel MainVm;
public AlbumsPage()
{
InitializeComponent();
if (ResourceLoader.Current.GetResource(ref _albumVm, Constants.ViewModelAlbum) == false)
_albumVm = new AlbumViewModel();
if (ResourceLoader.Current.GetResource(ref _playlistVm, Constants.ViewModelPlaylist) == false)
_playlistVm = new PlaylistViewModel();
if (ResourceLoader.Current.GetResource(ref AlbumVm, Constants.ViewModelAlbum) == false)
AlbumVm = new AlbumViewModel();
if (ResourceLoader.Current.GetResource(ref PlaylistVm, Constants.ViewModelPlaylist) == false)
PlaylistVm = new PlaylistViewModel();
if (ResourceLoader.Current.GetResource(ref MainVm, Constants.ViewModelMain) == false)
MainVm = new MainViewModel();
}
protected override async void OnNavigatedTo(NavigationEventArgs e)
{
Microsoft.HockeyApp.HockeyClient.Current.TrackPageView(GetType().Name);
await _albumVm.LoadDataAsync();
ListViewSource.Source = _albumVm.Items;
await AlbumVm.LoadDataAsync();
ListViewSource.Source = AlbumVm.Items;
var listViewBase = SemanticZoomContainer.ZoomedOutView as ListViewBase;
if (listViewBase != null)
listViewBase.ItemsSource = ListViewSource.View.CollectionGroups;
......@@ -36,19 +41,21 @@ namespace SonicStreamer.Pages
Frame.Navigate(typeof(TrackListingPage), e.ClickedItem);
}
private async void PlaylistFlyout_Opening(object sender, object e)
private async void AddToPlaylist_Click(object sender, RoutedEventArgs e)
{
await _playlistVm.LoadFlyoutDataAsync();
AddToPlaylistDialog.Content = new AddToPlaylistDialog();
var dialogResult = await AddToPlaylistDialog.ShowAsync();
if (dialogResult == ContentDialogResult.Primary)
{
await AlbumVm.AddToPlaylistAsync();
}
PlaylistVm.ResetDialogInputs();
}
private void PlaylistFlyout_Closed(object sender, object e)
private async void AddToPlaylistDialog_OnOpened(ContentDialog sender, ContentDialogOpenedEventArgs args)
{
_playlistVm.ResetFlyoutInputs();
}
private void AddToPlayback_Click(object sender, RoutedEventArgs e)
{
PlaylistFlyout.Hide();
await PlaylistVm.LoadDialogDataAsync();
}
}
}
\ No newline at end of file
......@@ -2,9 +2,7 @@
x:Class="SonicStreamer.Pages.ArtistsPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
DataContext="{Binding Source={StaticResource ArtistVM}}"
NavigationCacheMode="Required"
......@@ -37,77 +35,22 @@
<CommandBar.Resources>
<Style BasedOn="{StaticResource OrangeAppBarButtonStyle}" TargetType="AppBarButton" />
</CommandBar.Resources>
<AppBarButton Icon="Play" Label="Play Selection">
<interactivity:Interaction.Behaviors>
<core:EventTriggerBehavior EventName="Click">
<core:CallMethodAction MethodName="PlayClick" TargetObject="{Binding Mode=OneWay}" />
</core:EventTriggerBehavior>
</interactivity:Interaction.Behaviors>
</AppBarButton>
<AppBarButton Icon="Add" Label="Add to Playback">
<interactivity:Interaction.Behaviors>
<core:EventTriggerBehavior EventName="Click">
<core:CallMethodAction MethodName="AddClick" TargetObject="{Binding Mode=OneWay}" />