本文整理汇总了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();
}
}
}
示例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;
}
示例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) }
};
}
示例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) }
};
}
示例5: AuthorizeViewModel
public AuthorizeViewModel(IResourceLoader loader, IGitHubService githubService, INavigationService navigationService)
{
_loader = loader;
_githubService = githubService;
_navigationService = navigationService;
InfoMessage = _loader.GetString("AuthZ_WhatIsOAuthDoing");
ShowAuthorizeButton = true;
}
示例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)
},
};
}
示例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)
},
};
}
示例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
}
};
}