Added tracking/capturing/restoration of audio playback state and position.

This commit is contained in:
2026-08-08 16:37:55 -04:00
parent c262ee4caa
commit 0942e3e5ad
11 changed files with 92 additions and 15 deletions

View File

@@ -56,6 +56,16 @@ public sealed partial class PlaylistDetailView : UserControl
SortSelectedByMenuFlyoutSubItem.IsEnabled = _viewModel.SortSelectedCommand.CanExecute(null);
SortSelectedByMenuFlyoutSubItem.IsEnabled = _viewModel.SortSelectedCommand.CanExecute(null);
Loaded += OnLoaded;
}
private void OnLoaded(object sender, RoutedEventArgs e)
{
Loaded -= OnLoaded;
// Defer until the ListView has completed its first layout/container realization pass.
DispatcherQueue.TryEnqueue(DispatcherQueuePriority.Low, BringPlayingSongIntoView);
}
private void OnViewModelPropertyChanging(object? sender, PropertyChangingEventArgs e)
@@ -274,7 +284,7 @@ public sealed partial class PlaylistDetailView : UserControl
if (args.NewValue is not PlaylistSong playlistSong)
return;
bool isPlaying = playlistSong == _viewModel.PlayingSong;
bool isPlaying = playlistSong.UID == _viewModel.PlayingSong?.UID;
UpdateListViewItemStyle(sender, isPlaying);
}