diff --git a/Harmonia.WinUI/Assets/Default.png b/Harmonia.WinUI/Assets/Default.png new file mode 100644 index 0000000..70836ed Binary files /dev/null and b/Harmonia.WinUI/Assets/Default.png differ diff --git a/Harmonia.WinUI/Harmonia.WinUI.csproj b/Harmonia.WinUI/Harmonia.WinUI.csproj index a426bfa..0d5320f 100644 --- a/Harmonia.WinUI/Harmonia.WinUI.csproj +++ b/Harmonia.WinUI/Harmonia.WinUI.csproj @@ -1,7 +1,7 @@  WinExe - net9.0-windows10.0.19041.0 + net9.0-windows10.0.26100.0 10.0.17763.0 Harmonia.WinUI app.manifest @@ -43,6 +43,7 @@ + @@ -59,6 +60,9 @@ Designer + + Designer + MSBuild:Compile diff --git a/Harmonia.WinUI/MainWindow.xaml b/Harmonia.WinUI/MainWindow.xaml index cc28803..835e214 100644 --- a/Harmonia.WinUI/MainWindow.xaml +++ b/Harmonia.WinUI/MainWindow.xaml @@ -5,6 +5,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:Harmonia.WinUI" xmlns:views="using:Harmonia.WinUI.Views" + xmlns:Media="using:CommunityToolkit.WinUI.Media" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" @@ -18,6 +19,22 @@ + + + + + + + + + + + + + + + + diff --git a/Harmonia.WinUI/MainWindow.xaml.cs b/Harmonia.WinUI/MainWindow.xaml.cs index bca50a0..376e62a 100644 --- a/Harmonia.WinUI/MainWindow.xaml.cs +++ b/Harmonia.WinUI/MainWindow.xaml.cs @@ -1,36 +1,11 @@ using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Controls; -using Microsoft.UI.Xaml.Controls.Primitives; -using Microsoft.UI.Xaml.Data; -using Microsoft.UI.Xaml.Input; -using Microsoft.UI.Xaml.Media; -using Microsoft.UI.Xaml.Navigation; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices.WindowsRuntime; -using Windows.Foundation; -using Windows.Foundation.Collections; -// To learn more about WinUI, the WinUI project structure, -// and more about our project templates, see: http://aka.ms/winui-project-info. +namespace Harmonia.WinUI; -namespace Harmonia.WinUI +public sealed partial class MainWindow : Window { - /// - /// An empty window that can be used on its own or navigated to within a Frame. - /// - public sealed partial class MainWindow : Window + public MainWindow() { - public MainWindow() - { - this.InitializeComponent(); - } - - private void myButton_Click(object sender, RoutedEventArgs e) - { - //myButton.Content = "Clicked"; - } + InitializeComponent(); } -} +} \ No newline at end of file diff --git a/Harmonia.WinUI/Resources/Geometry.xaml b/Harmonia.WinUI/Resources/Geometry.xaml index 78f6bb3..0a0ff2d 100644 --- a/Harmonia.WinUI/Resources/Geometry.xaml +++ b/Harmonia.WinUI/Resources/Geometry.xaml @@ -122,4 +122,13 @@ M11 1a2 2 0 0 0-2 2v4a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h5V3a3 3 0 0 1 6 0v4a.5.5 0 0 1-1 0V3a2 2 0 0 0-2-2M3 8a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V9a1 1 0 0 0-1-1z + + M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4 + + + + M3 9.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3 + + + diff --git a/Harmonia.WinUI/Resources/Styles.xaml b/Harmonia.WinUI/Resources/Styles.xaml index afea6c8..ad73a73 100644 --- a/Harmonia.WinUI/Resources/Styles.xaml +++ b/Harmonia.WinUI/Resources/Styles.xaml @@ -10,6 +10,11 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Harmonia.WinUI/Views/PlaylistView.xaml.cs b/Harmonia.WinUI/Views/PlaylistView.xaml.cs new file mode 100644 index 0000000..58d5c2d --- /dev/null +++ b/Harmonia.WinUI/Views/PlaylistView.xaml.cs @@ -0,0 +1,57 @@ +using Harmonia.Core.Playlists; +using Harmonia.WinUI.ViewModels; +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Input; +using System.Threading.Tasks; + +namespace Harmonia.WinUI.Views; + +public sealed partial class PlaylistView : UserControl +{ + private readonly PlaylistViewModel _viewModel; + + public PlaylistView() + { + InitializeComponent(); + _viewModel = (PlaylistViewModel)DataContext; + } + + private void Image_Loaded(object sender, RoutedEventArgs e) + { + //Image? image = sender as Image; + + //if (image == null) + // return; + + //image.DataContextChanged += Image_DataContextChanged; + + //var song = (PlaylistSong)image.DataContext; + + //if (song == null) + // return; + + //Task.Run(async () => await FetchImage(song.Song, image)); + } + + private void Image_Unloaded(object sender, RoutedEventArgs e) + { + //Image? image = sender as Image; + + //if (image == null) + // return; + + //image.DataContextChanged -= Image_DataContextChanged; + } + + private async void PlaylistListViewItem_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e) + { + if (sender is not FrameworkElement element) + return; + + if (element == null || element.DataContext is not PlaylistSong playlistSong) + return; + + await _viewModel.PlaySongAsync(playlistSong); + } +} \ No newline at end of file