From 11e1b336c75de41fc3e725441d0b5b7047603033 Mon Sep 17 00:00:00 2001 From: Royce551 Date: Sun, 10 Apr 2022 13:28:45 -0500 Subject: [PATCH] working tab switcher --- .../FRESHMusicPlayer-Avalonia.csproj | 2 +- .../ViewModels/MainWindowViewModel.cs | 12 ++++++++++++ .../FRESHMusicPlayer-Avalonia/Views/MainWindow.axaml | 10 +++++----- .../Views/MainWindow.axaml.cs | 2 +- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/FRESHMusicPlayer/FRESHMusicPlayer-Avalonia/FRESHMusicPlayer-Avalonia.csproj b/FRESHMusicPlayer/FRESHMusicPlayer-Avalonia/FRESHMusicPlayer-Avalonia.csproj index c5cc57c..ae94413 100644 --- a/FRESHMusicPlayer/FRESHMusicPlayer-Avalonia/FRESHMusicPlayer-Avalonia.csproj +++ b/FRESHMusicPlayer/FRESHMusicPlayer-Avalonia/FRESHMusicPlayer-Avalonia.csproj @@ -29,7 +29,7 @@ - + diff --git a/FRESHMusicPlayer/FRESHMusicPlayer-Avalonia/ViewModels/MainWindowViewModel.cs b/FRESHMusicPlayer/FRESHMusicPlayer-Avalonia/ViewModels/MainWindowViewModel.cs index a62a59c..b7863a0 100644 --- a/FRESHMusicPlayer/FRESHMusicPlayer-Avalonia/ViewModels/MainWindowViewModel.cs +++ b/FRESHMusicPlayer/FRESHMusicPlayer-Avalonia/ViewModels/MainWindowViewModel.cs @@ -341,6 +341,13 @@ namespace FRESHMusicPlayer.ViewModels } #endregion + + public FontWeight TracksTabWeight => SelectedTab == Tab.Tracks ? FontWeight.Bold : FontWeight.Regular; + public FontWeight ArtistsTabWeight => SelectedTab == Tab.Artists ? FontWeight.Bold : FontWeight.Regular; + public FontWeight AlbumsTabWeight => SelectedTab == Tab.Albums ? FontWeight.Bold : FontWeight.Regular; + public FontWeight PlaylistsTabWeight => SelectedTab == Tab.Playlists ? FontWeight.Bold : FontWeight.Regular; + public FontWeight ImportTabWeight => SelectedTab == Tab.Import ? FontWeight.Bold : FontWeight.Regular; + private Tab selectedTab = Tab.Tracks; public Tab SelectedTab { @@ -349,6 +356,11 @@ namespace FRESHMusicPlayer.ViewModels { selectedTab = value; this.RaisePropertyChanged(nameof(MainContent)); + this.RaisePropertyChanged(nameof(TracksTabWeight)); + this.RaisePropertyChanged(nameof(ArtistsTabWeight)); + this.RaisePropertyChanged(nameof(AlbumsTabWeight)); + this.RaisePropertyChanged(nameof(PlaylistsTabWeight)); + this.RaisePropertyChanged(nameof(ImportTabWeight)); } } private Pane selectedPane = Pane.None; diff --git a/FRESHMusicPlayer/FRESHMusicPlayer-Avalonia/Views/MainWindow.axaml b/FRESHMusicPlayer/FRESHMusicPlayer-Avalonia/Views/MainWindow.axaml index 8c791b6..bf05086 100644 --- a/FRESHMusicPlayer/FRESHMusicPlayer-Avalonia/Views/MainWindow.axaml +++ b/FRESHMusicPlayer/FRESHMusicPlayer-Avalonia/Views/MainWindow.axaml @@ -187,11 +187,11 @@ - - - - - + + + + +