示例#1
0
        public static Task <IUICommand> ShowDialogAsync(string content, string title = null)
        {
            var dialog = new MessageDialog(content, title ?? string.Empty);
            var handle = NativeMethods.GetActiveWindow();

            if (handle == IntPtr.Zero)
            {
                throw new InvalidOperationException();
            }

            InitializeWithWindow.Initialize(dialog, handle);
            return(dialog.ShowAsync().AsTask <IUICommand>());
        }
示例#2
0
        private static void SetOwnerWindow(StoreContext context, Window window)
        {
            var handle = new WindowInteropHelper(window).Handle;

            InitializeWithWindow.Initialize(context, handle);
        }