@@ -531,6 +531,18 @@ protected override void OnNavigatedTo(Microsoft.UI.Xaml.Navigation.NavigationEve
531531
532532 MyViewModel . CurrentWinUIPage = this ;
533533 MyViewModel . MySongsTableView = MySongsTableView ;
534+
535+ // Subscribe to playback feedback events
536+ MyViewModel . OnSongAddedToQueue += ( sender , message ) =>
537+ {
538+ ShowNotification ( message , Microsoft . UI . Xaml . Controls . InfoBarSeverity . Success ) ;
539+ } ;
540+
541+ MyViewModel . OnSongPlayingNow += ( sender , message ) =>
542+ {
543+ ShowNotification ( message , Microsoft . UI . Xaml . Controls . InfoBarSeverity . Informational ) ;
544+ } ;
545+
534546 // Now that the ViewModel is set, you can set the DataContext.
535547 this . DataContext = MyViewModel ;
536548 }
@@ -1383,4 +1395,39 @@ private void SelectedSongImg_Loaded(object sender, RoutedEventArgs e)
13831395 if ( ! string . IsNullOrEmpty ( MyViewModel . SelectedSong . CoverImagePath ) )
13841396 SelectedSongImg . Source = new BitmapImage ( new Uri ( MyViewModel . SelectedSong . CoverImagePath ) ) ;
13851397 }
1398+
1399+ private void ShowNotification ( string message , Microsoft . UI . Xaml . Controls . InfoBarSeverity severity )
1400+ {
1401+ // Use a TeachingTip or create a temporary InfoBar for notifications
1402+ // For now, we'll use a simple ContentDialog approach or you can add an InfoBar to the XAML
1403+ DispatcherQueue . TryEnqueue ( ( ) =>
1404+ {
1405+ var infoBar = new Microsoft . UI . Xaml . Controls . InfoBar
1406+ {
1407+ Message = message ,
1408+ Severity = severity ,
1409+ IsOpen = true ,
1410+ Margin = new Microsoft . UI . Xaml . Thickness ( 0 , 0 , 0 , 10 )
1411+ } ;
1412+
1413+ // Auto-close after 3 seconds
1414+ var timer = new DispatcherTimer { Interval = TimeSpan . FromSeconds ( 3 ) } ;
1415+ timer . Tick += ( s , args ) =>
1416+ {
1417+ infoBar . IsOpen = false ;
1418+ timer . Stop ( ) ;
1419+ // Remove from visual tree after closing animation
1420+ var parentPanel = infoBar . Parent as Panel ;
1421+ parentPanel ? . Children . Remove ( infoBar ) ;
1422+ } ;
1423+
1424+ // Add to the page's main grid (assuming there's a Grid named MyPageGrid)
1425+ if ( MyPageGrid is Grid grid && grid . Children . Count > 0 )
1426+ {
1427+ // Insert at the top of the grid
1428+ grid . Children . Insert ( 0 , infoBar ) ;
1429+ timer . Start ( ) ;
1430+ }
1431+ } ) ;
1432+ }
13861433}
0 commit comments