当前位置: 首页>>代码示例>>C#>>正文


C# IResourceLoader.GetString方法代码示例

本文整理汇总了C#中IResourceLoader.GetString方法的典型用法代码示例。如果您正苦于以下问题:C# IResourceLoader.GetString方法的具体用法?C# IResourceLoader.GetString怎么用?C# IResourceLoader.GetString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IResourceLoader的用法示例。


在下文中一共展示了IResourceLoader.GetString方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MenuViewModel

        public MenuViewModel(IEventAggregator eventAggregator, INavigationService navigationService, IResourceLoader resourceLoader, ISessionStateService sessionStateService)
        {
            eventAggregator.GetEvent<NavigationStateChangedEvent>().Subscribe(OnNavigationStateChanged);
            _navigationService = navigationService;
            _sessionStateService = sessionStateService;

            Commands = new ObservableCollection<MenuItemViewModel>
            {
                new MenuItemViewModel { DisplayName = resourceLoader.GetString("MainPageMenuItemDisplayName"), FontIcon = "\ue15f", Command = new DelegateCommand(() => NavigateToPage(PageTokens.Main), () => CanNavigateToPage(PageTokens.Main)) },
                new MenuItemViewModel { DisplayName = resourceLoader.GetString("SecondPageMenuItemDisplayName"), FontIcon = "\ue19f", Command = new DelegateCommand(() => NavigateToPage(PageTokens.Second), () => CanNavigateToPage(PageTokens.Second)) }
            };

            _canNavigateLookup = new Dictionary<PageTokens, bool>();

            foreach (PageTokens pageToken in Enum.GetValues(typeof(PageTokens)))
            {
                _canNavigateLookup.Add(pageToken, true);
            }

            if (_sessionStateService.SessionState.ContainsKey(CurrentPageTokenKey))
            {
                // Resuming, so update the menu to reflect the current page correctly
                PageTokens currentPageToken;
                if (Enum.TryParse(_sessionStateService.SessionState[CurrentPageTokenKey].ToString(), out currentPageToken))
                {
                    UpdateCanNavigateLookup(currentPageToken);
                    RaiseCanExecuteChanged();
                }
            }
        }
开发者ID:ali-hk,项目名称:Prism-Samples-Windows,代码行数:30,代码来源:MenuViewModel.cs

示例2: MenuViewModel

        public MenuViewModel(INavigationService navigationService, IResourceLoader resourceLoader)
        {
            _navigationService = navigationService;

            Commands = new ObservableCollection<MenuItemViewModel>
            {
                new MenuItemViewModel { DisplayName = resourceLoader.GetString("DTSBehaviorSampleMenuItemDisplayName"), FontIcon = "\ue15f", Command = new DelegateCommand(() => NavigateToSamplePage(PageTokens.DTSBehaviorSample), () => CanNavigateToSamplePage(PageTokens.DTSBehaviorSample)) },
                new MenuItemViewModel { DisplayName = resourceLoader.GetString("DTSSampleMenuItemDisplayName"), FontIcon = "\ue19f", Command = new DelegateCommand(() => NavigateToSamplePage(PageTokens.DTSSample), () => CanNavigateToSamplePage(PageTokens.DTSSample)) },
                new MenuItemViewModel { DisplayName = resourceLoader.GetString("IncrementalLoadingMenuItemDisplayName"), FontIcon = "\ue19f", Command = new DelegateCommand(() => NavigateToSamplePage(PageTokens.IncrementalLoadingSample), () => CanNavigateToSamplePage(PageTokens.IncrementalLoadingSample)) },
                new MenuItemViewModel { DisplayName = resourceLoader.GetString("DeferLoadStrategyMenuItemDisplayName"), FontIcon = "\ue19f", Command = new DelegateCommand(() => NavigateToSamplePage(PageTokens.DeferLoadStrategySample), () => CanNavigateToSamplePage(PageTokens.DeferLoadStrategySample)) },
                new MenuItemViewModel { DisplayName = resourceLoader.GetString("CustomLVIPMenuItemDisplayName"), FontIcon = "\ue19f", Command = new DelegateCommand(() => NavigateToSamplePage(PageTokens.CustomLVIPSample), () => CanNavigateToSamplePage(PageTokens.CustomLVIPSample)) },
                new MenuItemViewModel { DisplayName = resourceLoader.GetString("StateTriggerMenuItemDisplayName"), FontIcon = "\ue19f", Command = new DelegateCommand(() => NavigateToSamplePage(PageTokens.StateTriggerSample), () => CanNavigateToSamplePage(PageTokens.StateTriggerSample)) },
                new MenuItemViewModel { DisplayName = resourceLoader.GetString("CVSMenuItemDisplayName"), FontIcon = "\ue19f", Command = new DelegateCommand(() => NavigateToSamplePage(PageTokens.CollectionViewSourceSample), () => CanNavigateToSamplePage(PageTokens.CollectionViewSourceSample)) },
                new MenuItemViewModel { DisplayName = resourceLoader.GetString("DeviceSpecificMenuItemDisplayName"), FontIcon = "\ue19f", Command = new DelegateCommand(() => NavigateToSamplePage(PageTokens.DeviceSpecificSample), () => CanNavigateToSamplePage(PageTokens.DeviceSpecificSample)) },
                new MenuItemViewModel { DisplayName = resourceLoader.GetString("ExpanderSampleMenuItemDisplayName"), FontIcon = "\ue19f", Command = new DelegateCommand(() => NavigateToSamplePage(PageTokens.ExpanderSample), () => CanNavigateToSamplePage(PageTokens.ExpanderSample)) },
                new MenuItemViewModel { DisplayName = resourceLoader.GetString("OldMainPageMenuItemDisplayName"), FontIcon = "\ue19f", Command = new DelegateCommand(() => NavigateToSamplePage(PageTokens.OldMain), () => CanNavigateToSamplePage(PageTokens.OldMain)) },
            };

            _currentPageToken = PageTokens.DTSBehaviorSample;
            _canNavigateLookup = new Dictionary<PageTokens, bool>();

            foreach (PageTokens pageToken in Enum.GetValues(typeof(PageTokens)))
            {
                _canNavigateLookup.Add(pageToken, true);
            }

            _canNavigateLookup[_currentPageToken] = false;
        }
开发者ID:ali-hk,项目名称:Toolkit,代码行数:28,代码来源:MenuViewModel.cs

示例3: ShellPageViewModel

        public ShellPageViewModel(IShellServices service, IResourceLoader resourceLoader)
        {
            this.service = service;

            MenuItems = new Collection<MenuItemsModel>
            {
                new MenuItemsModel { DisplayName=resourceLoader.GetString("Home"), Icon="\xe1d2", Command=new DelegateCommand(service.NavigateHome) },
                new MenuItemsModel { DisplayName=resourceLoader.GetString("Local"), Icon="\xe2af", Command= new DelegateCommand(service.NavigateLocal) },
                new MenuItemsModel { DisplayName=resourceLoader.GetString("Server"), Icon="\xe1d2", Command=new DelegateCommand(service.NavigateServer) }
            };

        }
开发者ID:mgarcmart,项目名称:DemoUniversal,代码行数:12,代码来源:ShellPageViewModel.cs

示例4: MenuViewModel

        public MenuViewModel(INavigationService navigationService, IResourceLoader resourceLoader)
        {
            // TODO: Add ability to indicate which page your on by listening for navigation events once the NuGet package has been updated. Change CanNavigate to use whether or not your on that page to return false.
            // As-is, if navigation occurs via the back button, we won't know and can't update the _canNavigate value
            _navigationService = navigationService;

            Commands = new ObservableCollection<MenuItemViewModel>
            {
                new MenuItemViewModel { DisplayName = resourceLoader.GetString("MainPageMenuItemDisplayName"), FontIcon = "\ue15f", Command = new DelegateCommand(NavigateToMainPage, CanNavigateToMainPage) },
                new MenuItemViewModel { DisplayName = resourceLoader.GetString("SecondPageMenuItemDisplayName"), FontIcon = "\ue19f", Command = new DelegateCommand(NavigateToSecondPage, CanNavigateToSecondPage) }
            };
        }
开发者ID:CruzerBoon,项目名称:Prism-Samples-Windows,代码行数:12,代码来源:MenuViewModel.cs

示例5: AuthorizeViewModel

        public AuthorizeViewModel(IResourceLoader loader, IGitHubService githubService, INavigationService navigationService)
        {
            _loader = loader;
            _githubService = githubService;
            _navigationService = navigationService;

            InfoMessage = _loader.GetString("AuthZ_WhatIsOAuthDoing");
            ShowAuthorizeButton = true;
        }
开发者ID:gautamkrishnar,项目名称:wpaghapp,代码行数:9,代码来源:AuthorizeViewModel.cs

示例6: MenuViewModel

 public MenuViewModel(INavigationService navigationService, IResourceLoader resourceLoader)
 {
     _navigationService = navigationService;
     Commands = new ObservableCollection<MenuItemViewModel>
     {
         new MenuItemViewModel
         {
             DisplayName = resourceLoader.GetString("LibraryDisplayName"),
             FontIcon ="\uE7bc",
             Command = new DelegateCommand(NavigateToLibrary, CanNavigateToLibrary)
         },
         new MenuItemViewModel
         {
             DisplayName = resourceLoader.GetString("FavoritesDisplayName"),
             FontIcon ="\uE734",
             Command = new DelegateCommand(NavigateToFavorites, CanNavigateToFavorites)
         },
     };
 }
开发者ID:ziilok,项目名称:BookReader,代码行数:19,代码来源:MenuViewModel.cs

示例7: MenuViewModel

        public MenuViewModel(INavigationService navigationService, IResourceLoader resourceLoader)
        {
            _navigationService = navigationService;

            Commands = new ObservableCollection<MenuItemViewModel>
            {
                new MenuItemViewModel
                {
                    DisplayName = resourceLoader.GetString(ResourceTokens.UsersMenuItemDisplayName),
                    FontIcon = "\ue8bd",
                    Command = new DelegateCommand(NavigateToMessagesView, () => _canNavigateToUsers)
                },
                new MenuItemViewModel
                {
                    DisplayName = resourceLoader.GetString(ResourceTokens.ApplicationsMenuItemDisplayName),
                    FontIcon = "\ue71d",
                    Command = new DelegateCommand(NavigateToContactsView, () => _canNavigateToApps)
                },
            };
        }
开发者ID:IndifferentDisdain,项目名称:MvvmThrowdown,代码行数:20,代码来源:MenuViewModel.cs

示例8: MenuViewModel

        public MenuViewModel(INavigationService navigationService, IResourceLoader resourceLoader)
        {
            this.navigationService = navigationService;

            Commands = new ObservableCollection<ButtonViewModel>() {
                new NavigationButtonViewModel(navigationService) {
                    DisplayName = resourceLoader.GetString("RootMenu_HomePageDisplayName"),
                    IconSource = baseIconFolder + "Menu-HomeIcon.png",
                    PageToken = PageTokens.HomePage
                },
                new NavigationButtonViewModel(navigationService) {
                    DisplayName = resourceLoader.GetString("RootMenu_RestoPageDisplayName"),
                    IconSource = baseIconFolder + "Menu-RestoIcon.png",
                    PageToken = PageTokens.RestoPage
                },
                new NavigationButtonViewModel(navigationService) {
                    DisplayName = resourceLoader.GetString("RootMenu_InfoPageDisplayName"),
                    IconSource = baseIconFolder + "Menu-InfoIcon.png",
                    PageToken = PageTokens.InfoPage
                },
                new NavigationButtonViewModel(navigationService) {
                    DisplayName = resourceLoader.GetString("RootMenu_NewsPageDisplayName"),
                    IconSource = baseIconFolder + "Menu-NewsIcon.png",
                    PageToken = PageTokens.NewsPage
                },
                new NavigationButtonViewModel(navigationService) {
                    DisplayName = resourceLoader.GetString("RootMenu_ActivitiesPageDisplayName"),
                    IconSource = baseIconFolder + "Menu-ActivitiesIcon.png",
                    PageToken = PageTokens.ActivitiesPage
                },
                new NavigationButtonViewModel(navigationService) {
                    DisplayName = resourceLoader.GetString("RootMenu_SchamperPageDisplayName"),
                    IconSource = baseIconFolder + "Menu-SchamperIcon.png",
                    PageToken = PageTokens.SchamperPage
                },
                new NavigationButtonViewModel(navigationService) {
                    DisplayName = resourceLoader.GetString("RootMenu_UrgentFmPageDisplayName"),
                    IconSource = baseIconFolder + "Menu-UrgentFmIcon.png",
                    PageToken = PageTokens.UrgentFmPage
                },
                new NavigationButtonViewModel(navigationService) {
                    DisplayName = resourceLoader.GetString("RootMenu_SettingsPageDisplayName"),
                    IconSource = baseIconFolder + "Menu-SettingsIcon.png",
                    PageToken = PageTokens.SettingsPage
                }
            };
        }
开发者ID:ZeusWPI,项目名称:hydra-windows,代码行数:47,代码来源:MenuViewModel.cs


注:本文中的IResourceLoader.GetString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。