【发布时间】:2014-09-20 08:50:24
【问题描述】:
我正在使用 windows 默认设置弹出添加一些自定义命令。但是现在我需要打开一个本地存储的 HTML 文件?我怎样才能做到这一点 ? 第二件事我想将我的弹出代码从 app.xaml.cs 移动到 app.xaml 任何帮助将不胜感激 以下是我的代码:
protected override void OnInitialize(IActivatedEventArgs args){
SettingsPane.GetForCurrentView().CommandsRequested += App_CommandsRequested; }
void App_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
SettingsCommand settingsCommand = new SettingsCommand(
"About",
"About",
command =>
{
var flyout = new SettingsFlyout();
flyout.Title = "About";
string file = "ms-appx-web:///assets/about/about.html";
flyout.Show();
}
);
args.Request.ApplicationCommands.Add(settingsCommand);
}
【问题讨论】:
标签: xaml c#-4.0 windows-store-apps winrt-xaml