Esempio n. 1
0
 private void PopulateNavItems()
 {
     //^^
     //{[{
     PrimaryItems.Add(new ShellNavigationItem("Shell_wts.ItemName".GetLocalized(), Symbol.Document, typeof(wts.ItemNameViewModel)));
     //}]}
 }
Esempio n. 2
0
 private async void OnGetPrimaryItems(IReadOnlyList <IStorageItem> items)
 {
     foreach (StorageFile item in items)
     {
         PrimaryItems.Add(await CustomItemFactory.Create(item));
     }
 }
Esempio n. 3
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));
        }
Esempio n. 5
0
        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
            });
        }
        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"));
        }
 private async void OnGetPrimaryItems(IReadOnlyList <IStorageItem> items)
 {
     foreach (StorageFile item in items)
     {
         PrimaryItems.Add(new CustomItem
         {
             Path                = item.Path,
             FileName            = item.Name,
             Image               = await GetImageOrDefaultAsync(item),
             OriginalStorageItem = item
         });
     }
 }
        /// <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));
        }
        /// <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));
        }
Esempio n. 10
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
            });
        }
Esempio n. 11
0
        protected override void CreateDefaultAppBarButtons()
        {
            base.CreateDefaultAppBarButtons();

            PrimaryItems.Add(new AppBarButton
            {
                Label = _locService["AppBarButton_Select_Text"],
                Icon  = new FontIcon {
                    Glyph = "\uE133", FontSize = 14
                },
                Command = ActivateSelectionModeCommand
            });
            PrimaryItems.Add(new AppBarButton
            {
                Label = _locService["AppBarButton_Filter_Text"],
                Icon  = new FontIcon {
                    Glyph = "\uE16E", FontSize = 14
                },
                Command = ShowPerformerFlyoutCommand
            });
        }
Esempio n. 12
0
        /// <summary>
        /// 添加菜单入口点到主要页面中。
        /// </summary>
        /// <param name="title">入口点菜单的标题。</param>
        /// <param name="dest">目标页面的类名称,将通过反射创建实例。</param>
        /// <param name="icon">UWP 的图标。</param>
        /// <param name="cg">学校命名空间,如果为空默认为全局类。</param>
        /// <param name="sel">是否被默认选中。</param>
        /// <param name="apple">iOS 系统展示的图标。为空时收起到信息查询中。</param>
        public void AddMenuEntry(string title, string dest, string icon, string cg = "", bool sel = false, string apple = "")
        {
            var item = new MasterPageItem(title, dest, icon, sel, cg);

            PrimaryItems.Add(item);

#if __IOS__
            if (apple != "")
            {
                AppleItems.Add(item);
                item.AppleIcon = new FileImageSource {
                    File = apple
                };
            }
            else
            {
                InAppEntrance.Add(new TapEntranceWrapper(item.Title, item.Title + "的入口。",
                                                         (nav) => nav.PushAsync(item.CorePage)
                                                         ));
            }
#endif
        }
Esempio n. 13
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")
            }));
        }
Esempio n. 14
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
                });
            }
        }