Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DialogService does not show dialogs view in modal page (Xamarin.Forms) #68

Closed
Adyvan opened this issue Jun 9, 2020 · 1 comment
Closed

Comments

@Adyvan
Copy link

Adyvan commented Jun 9, 2020

DialogService does not show dialogs view if right now visible some modal page:

In Application class (App.xaml.cs):

await NavigationService.NavigateAsync($"{nameof(NavigationPage)}/{nameof(SomeContentPage)}");

in SomeContentPageViewModel

        private INavigationService navigationService { get; private set; }
        public Command OpenModalPage { get; set; }
        public SomeContentPageViewModel(INavigationService navigationService)
        {
            this.navigationService = navigationService;
            OpenModalPage = new Command(NavigateToModalPage);
        }

        private void NavigateToModalPage()
        {
             navigationService.NavigateAsync($"{nameof(SomeModalContentPage)}", useModalNavigation: true);
        }

in SomeModalContentPageViewModel

           private readonly IDialogService dialogService;
           public SomeModalContentPageViewModel(IDialogService dialogService)
        {
            this.dialogService = dialogService;
        }
.....
            dialogService.ShowDialog("DialogView", new DialogParameters
           {
               {"message" , message },
               {"backgroundColor", Color.FromHex("#D0021B") }
           });
....

also have DialogView.xaml

<?xml version="1.0" encoding="UTF-8"?>
<Frame xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:prism="http://prismlibrary.com"
             x:Class="Test.Forms.Views.DialogViews.DialogView"
             prism:DialogLayout.RelativeWidthRequest="1"
             prism:DialogLayout.CloseOnBackgroundTapped="{Binding CloseOnTap}">
    <StackLayout>
         <Label Text="{Binding Message}"
                HorizontalTextAlignment="Center"/>
    </StackLayout>
</Frame>

after execute dialogServic.show dialog in SomeModalContentPageViewModel we don't see dialog view.. actually the dialog view add in SomeContentPage but don't add in SomeModalContentPage

@Adyvan Adyvan closed this as completed Jun 9, 2020
@lock
Copy link

lock bot commented Jun 24, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant