嗨,我正在以这种方式在我的 Windows 8 Metro 应用程序中使用 Callisto 中的设置飞出:-
protected override void OnNavigatedTo(NavigationEventArgs e)
{
SettingsPane.GetForCurrentView().CommandsRequested += MainPage_CommandsRequested;
}
private void Button_Click_1(object sender, RoutedEventArgs e)
{
SettingsPane.Show();
}
void MainPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
SettingsCommand storage = new SettingsCommand("SettingsW", "Settings Wide", (x) =>
{
SettingsFlyout settings = new SettingsFlyout();
settings.FlyoutWidth = Callisto.Controls.SettingsFlyout.SettingsFlyoutWidth.Wide;
settings.HeaderText = "Settings Wide";
settings.Content = new CallistoSettings.SettingsViews.SettingsWide();
settings.IsOpen = true;
});
args.Request.ApplicationCommands.Add(storage);
// Settings Narrow
SettingsCommand settingsNarrow = new SettingsCommand("SettingsNarrow", "Settings Narrow", (x) =>
{
SettingsFlyout settings = new SettingsFlyout();
settings.FlyoutWidth = Callisto.Controls.SettingsFlyout.SettingsFlyoutWidth.Narrow;
settings.HeaderBrush = new SolidColorBrush(Colors.Orange);
settings.Background = new SolidColorBrush(Colors.Gray);
settings.HeaderText = "Settings Narrow";
settings.Content = new CallistoSettings.SettingsViews.SettingsNarrow();
settings.IsOpen = true;
});
args.Request.ApplicationCommands.Add(settingsNarrow);
// About
SettingsCommand about = new SettingsCommand("About", "About", (x) =>
{
SettingsFlyout settings = new SettingsFlyout();
settings.FlyoutWidth = Callisto.Controls.SettingsFlyout.SettingsFlyoutWidth.Narrow;
settings.HeaderText = "About";
settings.Content = new CallistoSettings.SettingsViews.About();
settings.IsOpen = true;
});
args.Request.ApplicationCommands.Add(about);
}
}
但我的疑问是:-
1)它打开了我按下的所需弹出按钮,但在顶部有一个返回按钮,如果我按下它会打开设置窗格,但我不想打开设置窗格(如果用户按下返回按钮存在于 settingflyout 之上,settingflyout 应该被关闭(如果我在设置窗格之外按下它会发生这种情况(灯光关闭))
我想要的是按下时我应该得到settingflyout,即使用户按下settingflyout后退按钮,它也应该关闭settingflyout而不是显示默认设置窗格。
请让我知道我怎样才能做到这一点。
提前致谢。