0

私の Windows 8 アプリには、チャーム バーのリンクをクリックすると表示されるポップアップがあります。現在のアプリケーションの可視フレームをポップアップに渡すにはどうすればよいですか? チャームバーを呼び出して設定を開く場所に基づいて、さまざまなことを表示および実行したいと思います。

設定ポップアップを作成するには、次のようにします。

void onCommandsRequested(SettingsPane settingsPane, SettingsPaneCommandsRequestedEventArgs eventArgs)
{
    UICommandInvokedHandler handler = new UICommandInvokedHandler(onSettingsCommand);

    SettingsCommand generalCommand = new SettingsCommand("SettingId", "Setting", handler);
    eventArgs.Request.ApplicationCommands.Add(generalCommand);

}

void onSettingsCommand(IUICommand command)
{
    // Create a SettingsFlyout the same dimenssions as the Popup.
    MyApp.Common.LayoutAwarePage mypane = new SettingsFlyout;
}
4

1 に答える 1

0

DataContextポップアップとして現在のフレームを渡すことができると思います。

var popup = new Popup();
popup.DataContext = this;
于 2012-10-26T21:34:22.960 に答える