Beispiel #1
0
 private async Task OnGetSecondaryItems(IReadOnlyList <IStorageItem> items)
 {
     foreach (StorageFile item in items)
     {
         SecondaryItems.Add(await CustomItemFactory.Create(item));
     }
 }
Beispiel #2
0
 private void PopulateNavItems()
 {
     //^^
     //{[{
     SecondaryItems.Add(new ShellNavigationItem("Shell_wts.ItemName".GetLocalized(), Symbol.Document, "wts.ItemName"));
     //}]}
 }
Beispiel #3
0
 private void PopulateNavItems()
 {
     //^^
     //{[{
     SecondaryItems.Add(new ShellNavigationItem("Shell_wts.ItemName".GetLocalized(), Symbol.Setting, typeof(wts.ItemNameViewModel)));
     //}]}
 }
Beispiel #4
0
        protected override void CreateSelectionAppBarButtons()
        {
            base.CreateSelectionAppBarButtons();

            PrimaryItems.Add(new AppBarButton
            {
                Label = _locService["AppBarButton_SelectAll_Text"],
                Icon  = new FontIcon {
                    Glyph = "\uE0E7"
                },
                Command = SelectAllCommand
            });

            if (LastPivotIndex == 1 && UserId == _inTouch.Session.UserId)
            {
                SecondaryItems.Add(new AppBarButton
                {
                    Label   = _locService["AppBarButton_Delete_Text"],
                    Command = DeleteSelectedCommand
                });
            }
            else
            {
                SecondaryItems.Add(new AppBarButton
                {
                    Label   = _locService["AppBarButton_AddToMyVideos_Text"],
                    Command = AddSelectedToMyVideosCommand
                });
            }
        }
        /// <summary>
        /// Populates the nav items.
        /// </summary>
        protected override void PopulateNavItems()
        {
            PrimaryItems.Clear();
            PrimaryItems.Add(new NavigationItem("Unlist Nuget packages", Application.Current.Resources["validation"] as string, ForegroundColor, Unlist_Command));

            SecondaryItems.Clear();
            SecondaryItems.Add(new NavigationItem("Help", Application.Current.Resources["help"] as string, ForegroundColor, Help_Command));
        }
        private void CreateDefaultAppBarButtons()
        {
            PrimaryItems.Clear();
            SecondaryItems.Clear();

            if (LastPivotIndex == 0)
            {
                PrimaryItems.Add(new AppBarButton
                {
                    Label = _locService["AppBarButton_Shuffle_Text"],
                    Icon  = new FontIcon {
                        Glyph = "\uE14B"
                    },
                    Command = PlayShuffleCommand
                });
            }

            PrimaryItems.Add(new AppBarButton
            {
                Label = _locService["AppBarButton_Refresh_Text"],
                Icon  = new FontIcon {
                    Glyph = "\uE117", FontSize = 14
                },
                Command = ReloadContentCommand
            });

            if (LastPivotIndex != 1)
            {
                PrimaryItems.Add(new AppBarButton
                {
                    Label = _locService["AppBarButton_Select_Text"],
                    Icon  = new FontIcon {
                        Glyph = "\uE133", FontSize = 14
                    },
                    Command = ActivateSelectionMode
                });
            }

            if (_launchViewResolver.LaunchViewName != AppConstants.DEFAULT_MAIN_VIEW)
            {
                PrimaryItems.Add(new AppBarButton
                {
                    Label = _locService["AppBarButton_Home_Text"],
                    Icon  = new FontIcon {
                        Glyph = "\uE10F"
                    },
                    Command = OpenMainViewCommand
                });
            }

            SecondaryItems.Add(new AppBarButton
            {
                Label   = _locService["AppBarButton_TransferManager_Text"],
                Command = OpenTransferManagerCommand
            });
        }
        protected override void CreateDefaultAppBarButtons()
        {
            SecondaryItems.Add(new AppBarButton
            {
                Label   = _locService["AppBarButton_TransferManager_Text"],
                Command = OpenTransferManagerCommand
            });

            base.CreateDefaultAppBarButtons();
        }
Beispiel #8
0
        protected override void CreateDefaultAppBarButtons()
        {
            SecondaryItems.Add(new AppBarButton
            {
                Label   = _locService["AppBarButton_DeleteAll_Text"],
                Command = DeleteAllCommand
            });

            base.CreateDefaultAppBarButtons();
        }
Beispiel #9
0
        private void PopulateNavItems()
        {
            _primaryItems.Clear();
            _secondaryItems.Clear();

            // TODO WTS: Change the symbols for each item as appropriate for your app
            // More on Segoe UI Symbol icons: https://docs.microsoft.com/windows/uwp/style/segoe-ui-symbol-font
            // Or to use an IconElement instead of a Symbol see https://github.com/Microsoft/WindowsTemplateStudio/blob/master/docs/projectTypes/navigationpane.md
            // Edit String/en-US/Resources.resw: Add a menu item title for each page
            PrimaryItems.Add(new ShellNavigationItem("Shell_Main".GetLocalized(), Symbol.Document, "Main"));
            PrimaryItems.Add(new ShellNavigationItem("Shell_MasterDetail".GetLocalized(), Symbol.Document, "MasterDetail"));
            SecondaryItems.Add(new ShellNavigationItem("Shell_Settings".GetLocalized(), Symbol.Setting, "Settings"));
        }
Beispiel #10
0
        protected override void CreateSelectionAppBarButtons()
        {
            if (!AddSelectedToMyAudiosSupported())
            {
                SecondaryItems.Add(new AppBarButton
                {
                    Label   = _locService["AppBarButton_Delete_Text"],
                    Command = DeleteSelectedCommand
                });
            }

            base.CreateSelectionAppBarButtons();
        }
        /// <summary>
        /// Populates the nav items.
        /// </summary>
        protected override void PopulateNavItems()
        {
            PrimaryItems.Clear();
            PrimaryItems.Add(new NavigationItem("Info", Application.Current.Resources["info"] as string, ForegroundColor, Info_Command));
            PrimaryItems.Add(new NavigationItem("Editable Combobox", Application.Current.Resources["combobox"] as string, ForegroundColor, EditableCombo_Command));
            PrimaryItems.Add(new NavigationItem("Validation", Application.Current.Resources["validation"] as string, ForegroundColor, ValidationTest_Command));
            PrimaryItems.Add(new NavigationItem("Unit Conversion", Application.Current.Resources["weight"] as string, ForegroundColor, UnitConversion_Command));

            SecondaryItems.Clear();
            SecondaryItems.Add(new NavigationItem("Help", Application.Current.Resources["help"] as string, ForegroundColor, Help_Command));
            SecondaryItems.Add(new NavigationItem("Language", Application.Current.Resources["flag"] as string, ForegroundColor, Language_Command));
            SecondaryItems.Add(new NavigationItem("Color", Application.Current.Resources["color"] as string, ForegroundColor, Color_Command));
            SecondaryItems.Add(new NavigationItem(Context.IsAuthenticated ? "Logout" : "Login", Application.Current.Resources["user2"] as string, ForegroundColor, Login_Command));
        }
        public override Task Initialize()
        {
            Items.Add(new MainMenuItemViewModel(LogProvider, NavigationService)
            {
                DisplayName         = "Find and Replace",
                TargetViewModelType = typeof(SearchAndReplaceViewModel)
            });

            SecondaryItems.Add(new MainMenuItemViewModel(LogProvider, NavigationService)
            {
                DisplayName         = "Settings",
                TargetViewModelType = typeof(SettingsViewModel)
            });

            return(Task.CompletedTask);
        }
        /// <summary>
        /// Populates the nav items.
        /// </summary>
        protected override void PopulateNavItems()
        {
            PrimaryItems.Clear();
            PrimaryItems.Add(new NavigationItem("SlideShow", Application.Current.Resources["kiosk"] as string, ForegroundColor, Display_Command));
            PrimaryItems.Add(new NavigationItem("Info", Application.Current.Resources["info"] as string, ForegroundColor, Info_Command));
            PrimaryItems.Add(new NavigationItem("Browse", Application.Current.Resources["search"] as string, ForegroundColor, Browse_Command));
            PrimaryItems.Add(new NavigationItem("Converters", Application.Current.Resources["products"] as string, ForegroundColor, Converter_Command));
            PrimaryItems.Add(new NavigationItem("Selection", Application.Current.Resources["multiselect"] as string, ForegroundColor, SelectionTest_Command));
            PrimaryItems.Add(new NavigationItem("ListView", Application.Current.Resources["products"] as string, ForegroundColor, ListViewTest_Command));
            PrimaryItems.Add(new NavigationItem("Validation", Application.Current.Resources["Validation"] as string, ForegroundColor, ValidationTest_Command));

            SecondaryItems.Clear();
            SecondaryItems.Add(new NavigationItem("Help", Application.Current.Resources["help"] as string, ForegroundColor, Help_Command));
            SecondaryItems.Add(new NavigationItem("Language", Application.Current.Resources["flag"] as string, ForegroundColor, Language_Command));
            SecondaryItems.Add(new NavigationItem("Theme", Application.Current.Resources["color"] as string, ForegroundColor, Color_Command));
            SecondaryItems.Add(new NavigationItem(Context.IsAuthenticated ? "Logout" : "Login", Application.Current.Resources["user2"] as string, ForegroundColor, Login_Command));
        }
Beispiel #14
0
        protected virtual void CreateDefaultAppBarButtons()
        {
            PrimaryItems.Clear();
            SecondaryItems.Clear();

            PrimaryItems.Add(new AppBarButton
            {
                Label = _locService["AppBarButton_Refresh_Text"],
                Icon  = new FontIcon {
                    Glyph = "\uE117", FontSize = 14
                },
                Command = ReloadCommand
            });

            SecondaryItems.Add(new AppBarButton
            {
                Label   = _locService["AppBarButton_TransferManager_Text"],
                Command = OpenTransferManagerCommand
            });
        }
Beispiel #15
0
        private void populateNavItems()
        {
            primaryItems.Clear();
            secondaryItems.Clear();

            // TODO WTS: Change the symbols for each item as appropriate for your app
            // More on Segoe UI Symbol icons: https://docs.microsoft.com/windows/uwp/style/segoe-ui-symbol-font
            // Or to use an IconElement instead of a Symbol see https://github.com/Microsoft/WindowsTemplateStudio/blob/master/docs/projectTypes/navigationpane.md
            // Edit String/en-US/Resources.resw: Add a menu item title for each page

            PrimaryItems.Add(PrismUnityApplication.Current.Container.Resolve <ShellNavigationViewModel>(new ResolverOverride[]
            {
                new ParameterOverride("label", "MyMusic".GetLocalized()), new ParameterOverride("symbol", "\uE189"), new ParameterOverride("pageIdentifier", "MyMusic")
            }));
            PrimaryItems.Add(PrismUnityApplication.Current.Container.Resolve <ShellNavigationViewModel>(new ResolverOverride[]
            {
                new ParameterOverride("label", "Playlists".GetLocalized()), new ParameterOverride("symbol", "\uE90B"), new ParameterOverride("pageIdentifier", "Playlist")
            }));
            PrimaryItems.Add(PrismUnityApplication.Current.Container.Resolve <ShellNavigationViewModel>(new ResolverOverride[]
            {
                new ParameterOverride("label", "Favorites".GetLocalized()), new ParameterOverride("symbol", "\uEB51"), new ParameterOverride("pageIdentifier", "Favorite")
            }));
            PrimaryItems.Add(PrismUnityApplication.Current.Container.Resolve <TuneInNavigationViewModel>(new ResolverOverride[]
            {
                new ParameterOverride("label", "TuneIn".GetLocalized()), new ParameterOverride("symbol", "\uEC05"), new ParameterOverride("pageIdentifier", "Radio")
            }));

            SecondaryItems.Add(PrismUnityApplication.Current.Container.Resolve <ManageZonesNavigationViewModel>(new ResolverOverride[]
            {
                new ParameterOverride("symbol", "\uE965"), new ParameterOverride("pageIdentifier", "Zone"), new ParameterOverride("secondPageIdentifier", "ManageZones")
            }));

            OtherItems.Add(PrismUnityApplication.Current.Container.Resolve <ShellNavigationViewModel>(new ResolverOverride[]
            {
                new ParameterOverride("label", "Settings".GetLocalized()), new ParameterOverride("symbol", "\uE115"), new ParameterOverride("pageIdentifier", "Settings")
            }));
        }
Beispiel #16
0
        /// <summary>
        /// 根据现有的预定义菜单内容添加入口点。
        /// </summary>
        private void FetchOptions()
        {
            PrimaryItems.Clear();
            SecondaryItems.Clear();

            SecondaryItems.Add(new MasterPageItem("设置", "SettingPage"));

#if __IOS__
            AppleItems.Clear();
            InAppEntrance.Clear();

            var settingList = new InfoEntranceGroup("设置")
            {
                new TapEntranceWrapper("设置", "调整程序运行的参数。",
                                       (nav) => nav.PushAsync(SecondaryItems[0].CorePage)),
                new TapEntranceWrapper("关于", "程序的版本信息、开发人员、许可证和隐私声明等。",
                                       (nav) => nav.PushAsync(new AboutPage())),
            };
#endif

            AddMenuEntry("首页", "IndexPage", "\xE10F", sel: true, apple: "tab_rec.png");
            AddMenuEntry("课程表", "SchedulePage", "\xECA5", apple: "tab_sched.png");

#if !__ANDROID__
            if (Core.App.Feed != null)
            {
                AddMenuEntry("学校通知", "FeedPage", "\xED0D", apple: "tab_feed.png");
            }
            if (Core.App.Message != null)
            {
                AddMenuEntry("站内消息", "MessagePage", "\xE715");
            }
#else
            if (Core.App.Feed != null && Core.App.Message != null)
            {
                AddMenuEntry("消息通知", "MessageTabbedPage", "\xE715");
            }
            else if (Core.App.Feed != null)
            {
                AddMenuEntry("学校通知", "FeedPage", "\xED0D");
            }
            else if (Core.App.Message != null)
            {
                AddMenuEntry("站内消息", "MessagePage", "\xE715");
            }
#endif

            if (Core.App.GradePoint != null)
            {
                AddMenuEntry("学分成绩", "GradePointPage", "\xE82D");
            }
            if (Core.App.InfoEntrances.Count > 0 || Core.RuntimePlatform == "iOS")
            {
                AddMenuEntry("信息查询", "InfoQueryPage", "\xE946", apple: "tab_about.png");
            }

#if __IOS__
            if (InAppEntrance.Count > 0)
            {
                Core.App.InfoEntrances.Insert(0, InAppEntrance);
            }
            Core.App.InfoEntrances.Add(settingList);
#endif
        }
Beispiel #17
0
        private void CreateSelectionAppBarButtons()
        {
            PrimaryItems.Clear();
            SecondaryItems.Clear();

            PrimaryItems.Add(new AppBarButton
            {
                Label = _locService["AppBarButton_Download_Text"],
                Icon  = new FontIcon {
                    Glyph = "\uE118"
                },
                Command = DownloadSelectedCommand
            });
            PrimaryItems.Add(new AppBarButton
            {
                Label = _locService["AppBarButton_Play_Text"],
                Icon  = new FontIcon {
                    Glyph = "\uE102"
                },
                Command = PlaySelectedCommand
            });
            PrimaryItems.Add(new AppBarButton
            {
                Label = _locService["AppBarButton_SelectAll_Text"],
                Icon  = new FontIcon {
                    Glyph = "\uE0E7"
                },
                Command = SelectAllCommand
            });

            if (_userID != 0 && _userID != _vkLoginService.UserID)
            {
                switch (LastPivotIndex)
                {
                case 0:
                    SecondaryItems.Add(new AppBarButton
                    {
                        Label   = _locService["AppBarButton_AddToMyAudios_Text"],
                        Command = AddSelectedToMyCollectionCommand
                    });
                    break;

                case 1:
                    SecondaryItems.Add(new AppBarButton
                    {
                        Label   = _locService["AppBarButton_AddToMyVideos_Text"],
                        Command = AddSelectedToMyCollectionCommand
                    });
                    break;

                case 2:
                    SecondaryItems.Add(new AppBarButton
                    {
                        Label   = _locService["AppBarButton_AddToMyDocs_Text"],
                        Command = AddSelectedToMyCollectionCommand
                    });
                    break;
                }
            }
            else
            {
                SecondaryItems.Add(new AppBarButton
                {
                    Label   = _locService["AppBarButton_Delete_Text"],
                    Command = DeleteSelectedCommand
                });
            }
        }