/// <summary> /// Class constructor for new-style navigation params. /// </summary> /// <param name="args">Navigation event args.</param> public LibraryViewModel(GroupedViewNavigationArgs args) : base(Window.Current.Dispatcher) { RegisterEventHandlers(); _isGrouped = true; _viewType = args.PageType; // Fallback or default title DesktopTitleViewConfiguration.SetTitleBarText( CommonSharedStrings.LibraryTitle); // Always set last used comparer. if (_viewType == CommonItemType.Song) { var groupState = new PageGroupingStateManager <CommonGroupedListView>(_viewType); var comparer = groupState.GetLastUsedPair(); GroupedItems = new GroupedSource(comparer.Indexer, comparer.GroupComparer, comparer.ItemComparer); } else if (_viewType == CommonItemType.Album || _viewType == CommonItemType.Artist) { var groupState = new PageGroupingStateManager <CommonGroupedGridView>(_viewType); var comparer = groupState.GetLastUsedPair(); GroupedItems = new GroupedSource(comparer.Indexer, comparer.GroupComparer, comparer.ItemComparer); } else { GroupedItems = new GroupedSource(args.EntityIndexer, args.GroupComparer, args.ItemComparer); } }
/// <summary> /// Class constructor for other pages. /// </summary> /// <param name="type">Page type.</param> /// <param name="pair">A pair of indexer and comparer.</param> public GroupedViewNavigationArgs(CommonItemType type, IndexerComparerPair pair) { PageType = type; SearchWord = string.Empty; EntityIndexer = pair.Indexer; GroupComparer = pair.GroupComparer; ItemComparer = pair.ItemComparer; }
/// <summary> /// Class constructor for other pages. /// </summary> /// <param name="type">Page type.</param> /// <param name="indexer">Entity indexer.</param> /// <param name="comparer">Entity compaerer.</param> public GroupedViewNavigationArgs(CommonItemType type, IEntityIndexer indexer, IComparer <string> groupComparer, IComparer <string> itemComparer) { PageType = type; SearchWord = string.Empty; EntityIndexer = indexer; GroupComparer = groupComparer; ItemComparer = itemComparer; }
/// <summary> /// Class constructor. /// </summary> /// <param name="type">Item type.</param> /// <param name="isGrouped">Indicates whether the value has been grouped.</param> public LibraryViewModel(CommonItemType type, bool isGrouped = false, string keyWord = "") : base(Window.Current.Dispatcher) { RegisterEventHandlers(); _isGrouped = isGrouped; _viewType = type; // Fallback or default title DesktopTitleViewConfiguration.SetTitleBarText( CommonSharedStrings.LibraryTitle); }
/// <summary> /// Class constructor for banned entity. /// </summary> /// <param name="type">Item entity.</param> /// <param name="name">Item name.</param> /// <param name="parentViewModel">Parental view model.</param> public CommonBannedEntity(CommonItemType type, string name, OnlineMetadataSettingsViewModel parentViewModel) { Type = type; Name = name; Delete = new DeleteCommand(parentViewModel, this); }
public AddButtonCommand(CommonItemType type, OnlineMetadataSettingsViewModel baseViewModelViewModel) { Type = type; m_baseViewModel = baseViewModelViewModel; m_executionCount = 0; }
/// <summary> /// Class constructor. /// </summary> /// <param name="type">View's item type.</param> public PageGroupingStateManager(CommonItemType type) { ItemType = type; _container = ApplicationData.Current.LocalSettings.CreateContainer($"{typeof(T).FullName}.{ItemType}", ApplicationDataCreateDisposition.Always); }