Added playlists view. Added messaging service. Added logic for adding and deleting playlists.

This commit is contained in:
2026-07-28 00:20:41 -04:00
parent 7cfcbf26cc
commit 62e53a29d4
13 changed files with 353 additions and 5 deletions

View File

@@ -123,6 +123,11 @@
<Setter Property="Background" Value="Transparent"></Setter>
</Style>
</MenuFlyout.MenuFlyoutPresenterStyle>
<MenuFlyoutItem Text="New Playlist" Command="{Binding NewPlaylistCommand}">
<MenuFlyoutItem.Icon>
<PathIcon Data="{StaticResource AddFileIcon}"></PathIcon>
</MenuFlyoutItem.Icon>
</MenuFlyoutItem>
<MenuFlyoutItem Text="Add Files..." Command="{Binding AddFilesCommand}">
<MenuFlyoutItem.Icon>
<PathIcon Data="{StaticResource AddFileIcon}"></PathIcon>
@@ -167,7 +172,7 @@
</MenuFlyoutItem>
<MenuFlyoutSeparator></MenuFlyoutSeparator>
<MenuFlyoutItem Text="Remove Playlist" Foreground="#ff99a4">
<MenuFlyoutItem Text="Remove Playlist" Foreground="#ff99a4" Command="{Binding DeletePlaylistCommand}">
</MenuFlyoutItem>
<MenuFlyoutSeparator></MenuFlyoutSeparator>
@@ -177,6 +182,12 @@
</MenuFlyout>
</Button.Flyout>
</Button>
<!--<Button Style="{StaticResource PremiumButton-Teal}">
<StackPanel Orientation="Horizontal" Spacing="8">
<PathIcon Style="{StaticResource FlatButtonIcon}" Foreground="{StaticResource PremiumTeaForegroundBrush}" Data="{StaticResource AddIcon}" />
<TextBlock Text="Go Premium"/>
</StackPanel>
</Button>-->
</StackPanel>
</Grid>
<ListView

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<UserControl
x:Class="Harmonia.WinUI.Views.PlaylistsView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Harmonia.WinUI.Views"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="using:Harmonia.WinUI.ViewModels"
xmlns:playlists="using:Harmonia.Core.Playlists"
DataContext="{Binding Source={StaticResource Locator}, Path=PlaylistsViewModel}"
d:DataContext="{d:DesignInstance Type=vm:PlaylistsViewModel, IsDesignTimeCreatable=True}"
mc:Ignorable="d">
<UserControl.Resources>
<DataTemplate x:Key="PlaylistTemplate" x:DataType="playlists:Playlist">
<StackPanel Orientation="Horizontal" Spacing="8" VerticalAlignment="Bottom">
<Viewbox Height="24" Width="24">
<PathIcon Data="{StaticResource MusicNoteList}" />
</Viewbox>
<TextBlock Text="{x:Bind Name}" FontSize="16" VerticalAlignment="Center" />
</StackPanel>
</DataTemplate>
</UserControl.Resources>
<Grid Margin="10">
<ListView
ItemsSource="{Binding Playlists, Mode=OneWay}"
SelectedItem="{Binding SelectedPlaylist, Mode=TwoWay}"
ItemTemplate="{StaticResource PlaylistTemplate}">
</ListView>
</Grid>
</UserControl>

View File

@@ -0,0 +1,12 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
namespace Harmonia.WinUI.Views;
public sealed partial class PlaylistsView : UserControl
{
public PlaylistsView()
{
InitializeComponent();
}
}