In OnLaunched() in App.xaml.cs:
SettingsPane.GetForCurrentView().CommandsRequested += CommandsRequested;
Then implement CommandsRequested() itself.
private void CommandsRequested(SettingsPane aSender, SettingsPaneCommandsRequestedEventArgs aEventArgs)
{
// Retrieve all the strings first
var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
string settingsCommandId = loader.GetString("aText");
string label = loader.GetString("aText");
//add the commands to the setting panel
aEventArgs.Request.ApplicationCommands.Add(
new SettingsCommand(settingsCommandId, label, aMethod));
}
沒有留言:
張貼留言