Ejemplo n.º 1
0
        private void Sample5_DialogHost_OnDialogClosing(object sender, DialogClosingEventArgs eventArgs)
        {
            Console.WriteLine("SAMPLE 5: Closing dialog with parameter: " + (eventArgs.Parameter ?? ""));

            //you can cancel the dialog close:
            //eventArgs.Cancel();

            if (!Equals(eventArgs.Parameter, true))
            {
                return;
            }

            if (!string.IsNullOrWhiteSpace(AnimalTextBox.Text))
            {
                AnimalListBox.Items.Add(AnimalTextBox.Text.Trim());
            }
        }
Ejemplo n.º 2
0
        private void ExtendedClosingEventHandler(object sender, DialogClosingEventArgs eventArgs)
        {
            if ((bool)eventArgs.Parameter == false)
            {
                return;
            }

            //OK, lets cancel the close...
            eventArgs.Cancel();

            //...now, lets update the "session" with some new content!
            eventArgs.Session.UpdateContent(new SampleProgressDialog());
            //note, you can also grab the session when the dialog opens via the DialogOpenedEventHandler

            //lets run a fake operation for 3 seconds then close this baby.
            Task.Delay(TimeSpan.FromSeconds(3))
            .ContinueWith((t, _) => eventArgs.Session.Close(false), null,
                          TaskScheduler.FromCurrentSynchronizationContext());
        }
Ejemplo n.º 3
0
 private void Sample2_DialogHost_OnDialogClosing(object sender, DialogClosingEventArgs eventArgs)
 {
     Console.WriteLine("SAMPLE 2: Closing dialog with parameter: " + (eventArgs.Parameter ?? ""));
 }
Ejemplo n.º 4
0
 private void ClosingEventHandler(object sender, DialogClosingEventArgs eventArgs)
 {
     Console.WriteLine("You can intercept the closing event, and cancel here.");
 }
Ejemplo n.º 5
0
 protected void OnDialogClosing(DialogClosingEventArgs eventArgs)
 {
     RaiseEvent(eventArgs);
 }