mirror of
https://github.com/Royce551/FRESHMusicPlayer.git
synced 2025-01-22 10:51:52 -05:00
Go to artist/album
This commit is contained in:
parent
cb8625711b
commit
340e76fd82
3 changed files with 57 additions and 49 deletions
|
@ -348,21 +348,7 @@ namespace FRESHMusicPlayer.ViewModels
|
|||
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
|
||||
{
|
||||
get => selectedTab;
|
||||
set
|
||||
{
|
||||
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));
|
||||
}
|
||||
}
|
||||
public Tab SelectedTab { get; private set; } = Tab.Tracks;
|
||||
private Pane selectedPane = Pane.None;
|
||||
public Pane SelectedPane
|
||||
{
|
||||
|
@ -374,35 +360,54 @@ namespace FRESHMusicPlayer.ViewModels
|
|||
}
|
||||
}
|
||||
|
||||
private UserControl mainContent;
|
||||
public UserControl MainContent
|
||||
{
|
||||
get
|
||||
get => mainContent;
|
||||
set => this.RaiseAndSetIfChanged(ref mainContent, value);
|
||||
}
|
||||
|
||||
public void ShowTab(Tab tab, string search = null)
|
||||
{
|
||||
SelectedTab = tab;
|
||||
this.RaisePropertyChanged(nameof(MainContent));
|
||||
this.RaisePropertyChanged(nameof(TracksTabWeight));
|
||||
this.RaisePropertyChanged(nameof(ArtistsTabWeight));
|
||||
this.RaisePropertyChanged(nameof(AlbumsTabWeight));
|
||||
this.RaisePropertyChanged(nameof(PlaylistsTabWeight));
|
||||
this.RaisePropertyChanged(nameof(ImportTabWeight));
|
||||
|
||||
switch (SelectedTab)
|
||||
{
|
||||
switch (SelectedTab)
|
||||
{
|
||||
case Tab.Tracks:
|
||||
return new LibraryTab().SetStuff(this, SelectedTab, null);
|
||||
case Tab.Artists:
|
||||
return new LibraryTab().SetStuff(this, SelectedTab, null);
|
||||
case Tab.Albums:
|
||||
return new LibraryTab().SetStuff(this, SelectedTab, null);
|
||||
case Tab.Playlists:
|
||||
return new LibraryTab().SetStuff(this, SelectedTab, null);
|
||||
case Tab.Import:
|
||||
return new ImportTab().SetStuff(this);
|
||||
case Tab.Fullscreen:
|
||||
return new UserControl
|
||||
case Tab.Tracks:
|
||||
MainContent = new LibraryTab().SetStuff(this, SelectedTab, search);
|
||||
break;
|
||||
case Tab.Artists:
|
||||
MainContent = new LibraryTab().SetStuff(this, SelectedTab, search);
|
||||
break;
|
||||
case Tab.Albums:
|
||||
MainContent = new LibraryTab().SetStuff(this, SelectedTab, search);
|
||||
break;
|
||||
case Tab.Playlists:
|
||||
MainContent = new LibraryTab().SetStuff(this, SelectedTab, search);
|
||||
break;
|
||||
case Tab.Import:
|
||||
MainContent = new ImportTab().SetStuff(this);
|
||||
break;
|
||||
case Tab.Fullscreen:
|
||||
MainContent = new UserControl
|
||||
{
|
||||
Content = new TextBlock
|
||||
{
|
||||
Content = new TextBlock
|
||||
{
|
||||
Text = "Fullscreen Page"
|
||||
}
|
||||
};
|
||||
default:
|
||||
throw new Exception("???");
|
||||
}
|
||||
Text = "Fullscreen Page"
|
||||
}
|
||||
};
|
||||
break;
|
||||
default:
|
||||
throw new Exception("???");
|
||||
}
|
||||
}
|
||||
|
||||
public UserControl AuxPaneContent
|
||||
{
|
||||
get
|
||||
|
@ -560,6 +565,10 @@ namespace FRESHMusicPlayer.ViewModels
|
|||
LoggingHandler.Log("Goodbye!");
|
||||
}
|
||||
|
||||
public void GoToArtistCommand() => ShowTab(Tab.Artists, Player.Metadata.Artists[0]);
|
||||
|
||||
public void GoToAlbumCommand() => ShowTab(Tab.Albums, Player.Metadata.Album);
|
||||
|
||||
public async Task PerformAutoImport()
|
||||
{
|
||||
if (Program.Config.AutoImportPaths.Count <= 0) return; // not really needed but prevents going through unneeded
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
</MenuItem>
|
||||
<MenuItem Command="{Binding OpenLyricsCommand}" Header="{x:Static resx:Resources.Lyrics}"/>
|
||||
<Separator/>
|
||||
<!--<MenuItem Command="{Binding MiniPlayerCommand}" Header="{x:Static resx:Resources.MiniPlayer}"/>-->
|
||||
<MenuItem Command="{Binding PauseAfterCurrentTrackCommand}" Header="{x:Static resx:Resources.Menu_Playback_PauseAfterCurrentTrack}"/>
|
||||
</ContextMenu>
|
||||
<vm:PauseAfterCurrentTrackToBrushConverter x:Key="PauseAfterCurrentTrackToBrushConverter"/>
|
||||
|
|
|
@ -115,11 +115,11 @@ namespace FRESHMusicPlayer.Views
|
|||
}
|
||||
}
|
||||
|
||||
private void OnTracksPressed(object sender, PointerPressedEventArgs e) => ViewModel.SelectedTab = Tab.Tracks;
|
||||
private void OnArtistsPressed(object sender, PointerPressedEventArgs e) => ViewModel.SelectedTab = Tab.Artists;
|
||||
private void OnAlbumsPressed(object sender, PointerPressedEventArgs e) => ViewModel.SelectedTab = Tab.Albums;
|
||||
private void OnPlaylistsPressed(object sender, PointerPressedEventArgs e) => ViewModel.SelectedTab = Tab.Playlists;
|
||||
private void OnImportPressed(object sender, PointerPressedEventArgs e) => ViewModel.SelectedTab = Tab.Import;
|
||||
private void OnTracksPressed(object sender, PointerPressedEventArgs e) => ViewModel.ShowTab(Tab.Tracks);
|
||||
private void OnArtistsPressed(object sender, PointerPressedEventArgs e) => ViewModel.ShowTab(Tab.Artists);
|
||||
private void OnAlbumsPressed(object sender, PointerPressedEventArgs e) => ViewModel.ShowTab(Tab.Albums);
|
||||
private void OnPlaylistsPressed(object sender, PointerPressedEventArgs e) => ViewModel.ShowTab(Tab.Playlists);
|
||||
private void OnImportPressed(object sender, PointerPressedEventArgs e) => ViewModel.ShowTab(Tab.Import);
|
||||
|
||||
private void OnPointerWheelChanged(object sender, PointerWheelEventArgs e)
|
||||
{
|
||||
|
@ -135,19 +135,19 @@ namespace FRESHMusicPlayer.Views
|
|||
ViewModel.OpenSettingsCommand();
|
||||
break;
|
||||
case Key.A:
|
||||
ViewModel.SelectedTab = Tab.Tracks;
|
||||
ViewModel.ShowTab(Tab.Tracks);
|
||||
break;
|
||||
case Key.S:
|
||||
ViewModel.SelectedTab = Tab.Artists;
|
||||
ViewModel.ShowTab(Tab.Artists);
|
||||
break;
|
||||
case Key.D:
|
||||
ViewModel.SelectedTab = Tab.Albums;
|
||||
ViewModel.ShowTab(Tab.Albums);
|
||||
break;
|
||||
case Key.F:
|
||||
ViewModel.SelectedTab = Tab.Playlists;
|
||||
ViewModel.ShowTab(Tab.Playlists);
|
||||
break;
|
||||
case Key.G:
|
||||
ViewModel.SelectedTab = Tab.Import;
|
||||
ViewModel.ShowTab(Tab.Import);
|
||||
break;
|
||||
case Key.E:
|
||||
ViewModel.OpenSearchCommand();
|
||||
|
|
Loading…
Reference in a new issue