Exemplo n.º 1
0
 public async override Task <bool> CanNavigateAsync(IConfirmNavigationParameters parameters)
 {
     if (parameters.GoingTo(typeof(Views.DetailPage)))
     {
         return(await _dialogService.AreYouSureAsync());
     }
     else
     {
         return(true);
     }
 }
Exemplo n.º 2
0
 public async override Task <bool> CanNavigateAsync(IConfirmNavigationParameters parameters)
 {
     if (parameters.ToNavigationInfo.PageType == typeof(Views.DetailPage))
     {
         var prompt = _resourceService.TryGetLocalizedString("AreYouSure", out var value) ? value : "Are you sure?";
         return(await _dialogService.PromptAsync(prompt, MessageBoxType.YesNo, MessageBoxResult.Yes));
     }
     else
     {
         return(true);
     }
 }
        public async override Task <bool> CanNavigateAsync(IConfirmNavigationParameters parameters)
        {
            var goingToDetails = parameters.ToNavigationInfo.PageType == typeof(Views.DetailPage);

            if (goingToDetails)
            {
                var dialog = new ContentDialog
                {
                    Title               = "Confirmation",
                    Content             = "Are you sure?",
                    PrimaryButtonText   = "Continue",
                    SecondaryButtonText = "Cancel",
                };
                var result = await dialog.ShowAsyncEx();

                return(result != ContentDialogResult.Secondary);
            }
            else
            {
                return(true);
            }
        }
Exemplo n.º 4
0
#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
        public async virtual Task <bool> CanNavigateAsync(IConfirmNavigationParameters parameters) => true;
Exemplo n.º 5
0
        public async virtual Task <bool> CanNavigateAsync(IConfirmNavigationParameters parameters)
        {
            await Task.CompletedTask;

            return(true);
        }
Exemplo n.º 6
0
        public async override Task <bool> CanNavigateAsync(IConfirmNavigationParameters parameters)
        {
            var result = await _DialogService.PromptAsync("Are you sure?");

            return(result == MessageBoxResult.Yes);
        }