示例#1
0
        private async void ClosingWindows(object o)
        {
            var view = new SampleDialog {
                Message = { Text = "È·¶¨¹Ø±Õ³ÌÐò£¿" }
            };

            await DialogHost.Show(view, "RootDialog", ExtendedOpenedEventHandler, ExtendedClosingEventHandler);
        }
示例#2
0
        private async void OnClick_ShowPageDialogAsync(object sender, RoutedEventArgs e)
        {
            var view = new SampleDialog
            {
                DataContext = new SampleDialogViewModel()
            };

            await DialogHost.Show(view, "DashboardPageDialog", ExtendedOpenedEventHandler, ExtendedClosingEventHandler);
        }
示例#3
0
        private async void ExecuteRunDialog(object o)
        {
            //let's set up a little MVVM, cos that's what the cool kids are doing:
            var view = new SampleDialog
            {
                DataContext = new LoginViewModel()
            };

            //show the dialog
            var result = await DialogHost.Show(view, "RootDialog", ClosingEventHandler);

            //check the result...
            Console.WriteLine("Dialog was closed, the CommandParameter used to close it was: " + (result ?? "NULL"));
        }
示例#4
0
        // Display the close dialog for KeyUp.
        private void graphicsButton1_KeyUp(object sender, KeyEventArgs e)
        {
            SampleDialog form = new SampleDialog();

            if (form.ShowDialog() == DialogResult.OK)
            {
                exporterHost.HWScanButton_Pressed -= hw_sbp;
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
        }