The first step is to add a listener for the CommandsRequest event on the SettingsPane for the page where you want the setting to be displayed. For example:
SettingsPane.GetForCurrentView().CommandsRequested += MainPage_CommandsRequested;
Then define the event handler
void MainPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
SettingsCommand generalCommand = new SettingsCommand("GeneralSettings", ResourceLoader.GetString("GeneralText"), (x) =>
{
SettingsFlyout settings = new SettingsFlyout();
settings.HeaderBrush = Resources["SettingsHeaderBrush"] as SolidColorBrush;
settings.HeaderText = ResourceLoader.GetString("GeneralText");
settings.Background = new SolidColorBrush(Windows.UI.Colors.White);
settings.Content = new GeneralSettingsFlyout();
settings.IsOpen = true;
settings.Height = Window.Current.Bounds.Height;
// Optionally, add a closed event handler
settings.Closed += settings_Closed;
});
}
Note that in this scenario, GeneralSettingsFlyout is simply a Page which will be loaded into the settings pane once that particular setting is selected (Callisto automatically handles this).
SettingsFlyout is the class from Callisto.