Exemple #1
0
        protected override void OnActivated(bool isFirstTimeActivate)
        {
            if (isFirstTimeActivate)
            {
                Container.Resolve <IMainFrame>().SetMenuItems(new List <MenuItemMetadata>()
                {
                    MenuItemMetadata.FromViewType <IStartPageView>("Start view"),
                    MenuItemMetadata.FromViewType <ITestDataPageView>("Test Data Page")
                });

                Container.Resolve <IApplicationSettingViewsService>().RegisterSettings <PrivacyView>("privacy", "Privacy");

                Container.Resolve <INavigationService>().NavigateTo <IStartPageView>();
            }
        }
Exemple #2
0
        public static IEnumerable <MenuItemMetadata> GetItems(IApplicationResources resources, IApplicationStateService stateService, ISettingsService settingsService)
        {
            yield return(MenuItemMetadata.FromViewType <IStartPageView>(new { Title = resources.GetString("MainMenu_Home"), Icon = "ms-appx:///Resources/home.png" }));

            yield return(MenuItemMetadata.FromViewType <ICurrentPlaylistPageView>(new { Title = resources.GetString("MainMenu_Queue"), Icon = "ms-appx:///Resources/queue.png" }));

            yield return(MenuItemMetadata.FromViewType <IUserPlaylistsPageView>(new { Title = resources.GetString("MainMenu_Playlists"), Icon = "ms-appx:///Resources/playlists.png" }, PlaylistType.UserPlaylist));

            yield return(MenuItemMetadata.FromViewType <IPlaylistsPageView>(new { Title = resources.GetString("MainMenu_Artists"), Icon = "ms-appx:///Resources/artists.png" }, PlaylistType.Artist));

            yield return(MenuItemMetadata.FromViewType <IPlaylistsPageView>(new { Title = resources.GetString("MainMenu_Albums"), Icon = "ms-appx:///Resources/albums.png" }, PlaylistType.Album));

            yield return(MenuItemMetadata.FromViewType <IPlaylistsPageView>(new { Title = resources.GetString("MainMenu_Genres"), Icon = "ms-appx:///Resources/genres.png" }, PlaylistType.Genre));

            if (stateService.CurrentState == ApplicationState.Online)
            {
                yield return(MenuItemMetadata.FromViewType <IRadioPageView>(new { Title = settingsService.GetIsAllAccessAvailable() ? resources.GetString("MainMenu_Radio") : resources.GetString("MainMenu_InstantMixes"), Icon = "ms-appx:///Resources/Radio.png" }, PlaylistType.Radio));
            }
        }