This repository has been archived on 2020-12-20. You can view files and clone it, but cannot push or open issues or pull requests.
aurora-sharp-desktop/Aurora/Design/Views/MainView/MainViewModel.cs

72 lines
2.7 KiB
C#
Raw Permalink Normal View History

using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.CompilerServices;
2019-07-05 18:17:09 +00:00
using Aurora.Design.Components.NavigationMenu;
using Aurora.Design.Views.Albums;
using Aurora.Design.Views.Artists;
using Aurora.Design.Views.Songs;
using Aurora.Design.Views.Stations;
using Aurora.Design.Views.Party;
using Aurora.Design.Views.Profile;
2019-07-05 18:17:09 +00:00
namespace Aurora.Design.Views.MainView
{
public class MainViewModel : BaseViewModel
{
private ObservableCollection<NavigationItem> _pages;
public ObservableCollection<NavigationItem> Pages
{
get { return _pages; }
set
{
if (value != _pages)
{
_pages = value;
OnPropertyChanged("Pages");
}
}
}
2019-12-02 04:20:55 +00:00
private NavigationItem _selectedItem;
public NavigationItem SelectedItem
{
get
{
return _selectedItem;
}
set
{
SetProperty(ref _selectedItem, value);
OnPropertyChanged("Title");
}
}
public string Title
{
get
{
return (_selectedItem != null && !string.IsNullOrWhiteSpace(_selectedItem.Title)) ?
_selectedItem.Title : "";
}
}
public MainViewModel()
{
_pages = new ObservableCollection<NavigationItem>(new[]
{
2019-12-01 11:53:30 +00:00
new NavigationItem { Id = 0, Title = "Songs", Group="Your Music", TargetType = typeof(SongsView), TargetViewModelType = typeof(SongsViewModel) },
new NavigationItem { Id = 1, Title = "Artists", Group="Your Music", TargetType = typeof(ArtistsView), TargetViewModelType = typeof(ArtistsViewModel)},
new NavigationItem { Id = 2, Title = "Albums", Group="Your Music", TargetType = typeof(AlbumsView), TargetViewModelType = typeof(AlbumsViewModel)},
new NavigationItem { Id = 3, Title = "Stations", Group="Your Music", TargetType = typeof(StationsView), TargetViewModelType = typeof(StationsViewModel)},
new NavigationItem { Id = 4, Title = "Party", Group="Social", TargetType = typeof(PartyView), TargetViewModelType = typeof(PartyViewModel)},
new NavigationItem { Id = 5, Title = "Profile", Group="Social", TargetType = typeof(ProfileView), TargetViewModelType = typeof(ProfileViewModel)},
2019-12-01 11:53:30 +00:00
new NavigationItem { Id = 6, Title = "A + B", Group="Playlists", TargetType = typeof(StationsView), TargetViewModelType = typeof(StationsViewModel)}
});
}
}
}