11

Windows 10 でメール ユニバーサル アプリを使用している場合、アカウントを追加すると (設定 -> アカウント -> アカウントの追加)、アカウントを選択するためのモーダル ウィンドウがポップアップするようです。MessageDialog を使用しようとしましたが、カスタム コンテンツを入れることができません。

編集:これはスクリーンショットです スクリーンショット

誰かがそれを実装する方法を知っていますか、それを実行できるAPIがありますか?

注:このウィンドウが開いているときは、メイン ウィンドウを最小化/最大化/閉じることさえできません。したがって、これは間違いなくモーダル ウィンドウです。

4

3 に答える 3

20

私はまだ自分で使用していませんが、ContentDialog api を探していると思います。

var dialog = new ContentDialog() {
    Title = "Lorem Ipsum",
    MaxWidth = this.ActualWidth // Required for Mobile!
    Content = YourXamlContent
};


dialog.PrimaryButtonText = "OK";
dialog.IsPrimaryButtonEnabled = false;
dialog.PrimaryButtonClick += delegate {
};

var result = await dialog.ShowAsync();

コンテンツ ダイアログ

ダイアログに関する msdn ガイドライン:リンク

msdn ContentDialog API: リンク

于 2015-08-04T08:46:03.940 に答える
5

たとえば、次のような新しいビューを簡単に作成できますApp.xaml.cs

public static async Task<bool> TryShowNewWindow<TView>(bool switchToView)
{
    var newView = CoreApplication.CreateNewView();
    int newViewId = 0;
    await newView.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
    {
        var frame = new Frame();
        frame.Navigate(typeof(TView), null);
        Window.Current.Content = frame;

        newViewId = ApplicationView.GetForCurrentView().Id;
    });
    var viewShown = await ApplicationViewSwitcher.TryShowAsStandaloneAsync(newViewId);
    if (switchToView && viewShown)
    {
        // Switch to new view
        await ApplicationViewSwitcher.SwitchAsync(newViewId);
    }
    return viewShown;
}

詳細については、次の 2 つのガイドをご覧ください。

于 2015-08-04T08:00:32.680 に答える
0

Template10 プロジェクト テンプレートを使用する場合は、ModalDialog コントロールを使用できます: https://github.com/Windows-XAML/Template10/wiki/Docs-%7C-Controls#modaldialog

于 2016-04-06T09:16:13.950 に答える