Skip to content

Commit

Permalink
fix: full playlist block for artists latest release
Browse files Browse the repository at this point in the history
  • Loading branch information
zznty committed Nov 9, 2024
1 parent 3c9159e commit b65bafa
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
14 changes: 12 additions & 2 deletions MusicX/Controls/ListPlaylists.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
xmlns:models="clr-namespace:MusicX.Core.Models;assembly=MusicX.Core"
xmlns:collections="clr-namespace:System.Collections;assembly=System.Runtime"
Margin="0,0,0,10"
d:DesignHeight="450"
d:DesignWidth="800"
x:Name="Control"
Expand All @@ -19,6 +18,9 @@
<DataTemplate DataType="{x:Type models:Playlist}" x:Key="FullPlaylistTemplate">
<local:PlaylistControl Margin="0,5" Width="200" Playlist="{Binding}" ShowFull="False" />
</DataTemplate>
<DataTemplate DataType="{x:Type models:Playlist}" x:Key="FullSinglePlaylistTemplate">
<local:PlaylistControl Playlist="{Binding}" ShowFull="True" />
</DataTemplate>
<DataTemplate DataType="{x:Type models:Playlist}" x:Key="PlaylistTemplate">
<local:PlaylistControl Margin="5,0" Width="200" Playlist="{Binding}" ShowFull="False" />
</DataTemplate>
Expand All @@ -41,7 +43,7 @@
</UserControl.Resources>

<UserControl.ContentTemplate>
<DataTemplate DataType="{x:Type collections:IEnumerable}">
<DataTemplate DataType="{x:Type collections:IList}">
<ui:ListView ItemsSource="{Binding}">
<ui:ListView.Style>
<Style TargetType="{x:Type ui:ListView}" BasedOn="{StaticResource ItemsListViewStyle}">
Expand All @@ -50,6 +52,14 @@
<Setter Property="ItemsPanel" Value="{StaticResource FullPlaylistPanelTemplate}"/>
<Setter Property="ItemTemplate" Value="{StaticResource FullPlaylistTemplate}"/>
</DataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding ShowFull, ElementName=Control}" Value="True" />
<Condition Binding="{Binding Count}" Value="1" />
</MultiDataTrigger.Conditions>

<Setter Property="ItemTemplate" Value="{StaticResource FullSinglePlaylistTemplate}"/>
</MultiDataTrigger>
<DataTrigger Binding="{Binding ShowFull, ElementName=Control}" Value="False">
<Setter Property="ItemsPanel" Value="{StaticResource PlaylistPanelTemplate}"/>
<Setter Property="ItemTemplate" Value="{StaticResource PlaylistTemplate}"/>
Expand Down
7 changes: 4 additions & 3 deletions MusicX/Controls/PlaylistControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,10 @@
<Grid
x:Name="FullGrid"
HorizontalAlignment="Stretch"
MouseLeftButtonDown="FullGrid_MouseLeftButtonDown"
Visibility="Collapsed">
<StackPanel Orientation="Horizontal">
<controls:CardAction IsChevronVisible="False" MinWidth="300"
Click="CardAction_Click">
<StackPanel Orientation="Horizontal">
<Grid>
<Rectangle
Grid.Row="0"
Expand Down Expand Up @@ -322,7 +323,7 @@

</StackPanel>
</StackPanel>

</controls:CardAction>
</Grid>


Expand Down
7 changes: 0 additions & 7 deletions MusicX/Controls/PlaylistControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,6 @@ private void CardAction_Click(object sender, RoutedEventArgs e)
notificationService.OpenExternalPage(new PlaylistView(Playlist));
}

private void FullGrid_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
var notificationService = StaticService.Container.GetRequiredService<NavigationService>();

notificationService.OpenExternalPage(new PlaylistView(Playlist));
}

private void PlayPlaylistGrid_MouseEnter(object sender, MouseEventArgs e)
{
//this.Cursor = Cursors.Hand;
Expand Down

0 comments on commit b65bafa

Please sign in to comment.