예제 #1
0
 private async void ShowDarkTheme(object sender, RoutedEventArgs e)
 {
     await DialogFactory
     .Alert("Dark dialog independent of application resources")
     .With(dialog => dialog.Theme = DialogTheme.Dark)
     .Show("RootDialog", LargeModalWidth);
 }
예제 #2
0
        private async void ShowModalPrompt(object sender, RoutedEventArgs e)
        {
            bool?result = await DialogFactory.Prompt("Delete item?").Show("RootDialog", ModalWidth);

            if (result == true)
            {
                await DialogFactory.Alert("Item deleted.").Show("RootDialog", ModalWidth);
            }
        }
예제 #3
0
 public static async Task Alert(this IDialogService dialogService, string message)
 {
     try
     {
         await dialogService.ShowTrackedDialog(DialogFactory.Alert(message), Route.SmallDialog).Task;
     }
     catch
     {
         // ignored
     }
 }
예제 #4
0
        private async void ShowModalInput(object sender, RoutedEventArgs e)
        {
            StringSchema schema = new StringSchema {
                Name = "Name", IconKind = PackIconKind.Account
            };
            bool?result =
                await DialogFactory.FromSingleSchema("What is your name?", schema).Show("RootDialog", LargeModalWidth);

            if (result == true)
            {
                string name = schema.Value;
                await DialogFactory.Alert($"Hello {name}!").Show("RootDialog", ModalWidth);
            }
        }
예제 #5
0
        private async void ShowMultiSchema(object sender, RoutedEventArgs e)
        {
            var dialog = new MaterialDialog
            {
                Form = new MaterialForm
                {
                    new CaptionSchema {
                        Name = "Personal details"
                    },
                    new MultiSchema(
                        new StringSchema {
                        Name = "First Name", Key = "first", IconKind = PackIconKind.Account
                    },
                        new StringSchema {
                        Name = "Last Name", Key = "last"
                    })
                    {
                        Key = "PersonalDetails"
                    },
                    new CaptionSchema {
                        Name = "Reservation details"
                    },
                    new MultiSchema(
                        new DateSchema {
                        Name = "Date", IconKind = PackIconKind.CalendarClock
                    },
                        new TimeSchema {
                        Name = "Time"
                    })
                    {
                        RelativeColumnWidths = new[] { 6d, 4d }
                    }
                }
            };

            bool?result = await dialog.Show("RootDialog", LargeModalWidth);

            if (result == true)
            {
                MaterialForm personalDetails = (MaterialForm)dialog.Form["PersonalDetails"];
                string       firstName       = (string)personalDetails["first"];
                string       lastName        = (string)personalDetails["last"];
                await DialogFactory.Alert($"Hello {firstName} {lastName}!").Show("RootDialog", ModalWidth);
            }
        }
예제 #6
0
 private async void ShowModalAlert(object sender, RoutedEventArgs e)
 {
     await DialogFactory.Alert("Hello World!").Show("RootDialog", ModalWidth);
 }