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

[BUG] Plugin.Popups.Maui on iOS navigate to new page when showing popup Page #3165

Closed
albilaga opened this issue Jun 14, 2024 · 12 comments
Closed

Comments

@albilaga
Copy link

Description

When using NavigationService.NavigateAsync(nameof(PopupPage)) in iOS it will be shown in new page instead of current page. I also doubt this is issue on Mopups because using MopupService.Instance.PushAsync(new PopupPage()) is working fine. On Android this is working fine

Steps to Reproduce

  1. Open this project https://github.com/albilaga/PrismPopupsIssue
  2. Run the project on iOS
  3. It will show new page when using prism NavigationService
    CleanShot 2024-06-14 at 13 27 22

Platform with bug

.NET MAUI

Affected platforms

iOS

Did you find any workaround?

Not yet found workaround

Relevant log output

No response

@ramtechjoe
Copy link

I am seeing the same behavior on iOS

@albilaga
Copy link
Author

Sorry. Looks like I am missing Popups need to rearchitect to use IDialogService. I am already using IDialogService as you can see in here but now because RegisterDialog forced to accept View instead of MopupsPage now it seems I can't pass animation or also make the dialog to become full screen and then put my popup to anywhere (example is to put it at the bottom of the page or let's say I want the page behind the dialog to be little dark). Is this the expected @dansiegel or is there any other way to do this? Should I make this as new issue? Thank you

@dansiegel
Copy link
Member

Actually I announced several years ago that you should migrate away from Page based Navigation with Popups to Dialogs. It was always scheduled for v9.0 to completely remove that support.

As far as Popup specific properties you can generally either set them with the attached properties from either the DialogLayout or PopupDialogLayout as shown below

<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:prism="http://prismlibrary.com"
             xmlns:animation="clr-namespace:Mopups.Animations;assembly=Mopups"
             prism:DialogLayout.CloseOnBackgroundTapped="False"
             prism:PopupDialogLayout.HasSystemPadding="False"
             x:Class="MauiApp2.MyDialog">
    <prism:PopupDialogLayout.Animation>
        <animation:MoveAnimation PositionIn="Top" PositionOut="Bottom" />
    </prism:PopupDialogLayout.Animation>
    <VerticalStackLayout>
        <Label 
            Text="Welcome to .NET MAUI!"
            VerticalOptions="Center" 
            HorizontalOptions="Center" />
    </VerticalStackLayout>
</ContentView>

@albilaga
Copy link
Author

Thank you @dansiegel . Attached properties working fine. But CloseOnBackgroundTapped do nothing and also how to make this view to be fullscreen. Let's say I want it to be something like this

<ContentView
    x:Class="PrismPopupsIssue.PopupView"
    xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:animations="clr-namespace:Mopups.Animations;assembly=Mopups"
    xmlns:prismPopupsIssue="clr-namespace:PrismPopupsIssue"
    xmlns:xaml="http://prismlibrary.com"
    Padding="40"
    x:DataType="prismPopupsIssue:PopupViewModel"
    xaml:DialogLayout.CloseOnBackgroundTapped="True"
    xaml:PopupDialogLayout.HasSystemPadding="False"
    BackgroundColor="#80000000"
    HorizontalOptions="Fill"
    VerticalOptions="Fill">
    <xaml:PopupDialogLayout.Animation>
        <animations:MoveAnimation PositionIn="Top" PositionOut="Bottom" />
    </xaml:PopupDialogLayout.Animation>
    <VerticalStackLayout
        BackgroundColor="White"
        Spacing="8"
        VerticalOptions="Center">
        <Label
            FontAttributes="Bold"
            FontSize="Header"
            HorizontalOptions="Center"
            Text="Hello from popup page" />
        <Button
            Command="{Binding GoBackCommand, Mode=OneTime}"
            HorizontalOptions="Center"
            Text="Go Back" />
    </VerticalStackLayout>
</ContentView>

so the whole page will have little dark background and only my VerticalStackLayout will have focus white like what Mopups do?

@ramtechjoe
Copy link

Seems I missed the memo also.

After setting up with Dialogs as described I am unable to get a background click to dismiss dialog (in iOS). I tried both methods of the attached property @dansiegel shows and doing in the navigate like @albilaga did in the related project

@dansiegel
Copy link
Member

@ramtechjoe please open an issue for the issue you're having with the Dismiss on Background Tapped so we can track that appropriately.

@albilaga
Copy link
Author

@dansiegel I added the new issue in here #3168

@ramtechjoe
Copy link

@albilaga Thanks for opening the new issue

@ramtechjoe
Copy link

@albilaga do you have any issues with the attached PopupDialogLayout? I cannot get things to compile when I have in my Xaml. Keep getting

XFC0000 Cannot resolve type "http://prismlibrary.com:PopupDialogLayout"

Weird thing is the intellisense shows up, so it at least in VS it seems like it sees it. But then won't compile

@albilaga
Copy link
Author

@ramtechjoe nope. This is working on my machine https://github.com/albilaga/PrismPopupsIssue/blob/main/PrismPopupsIssue/PopupView.xaml#L17 ( I am using rider)

@AnthonyLatty
Copy link

AnthonyLatty commented Sep 17, 2024

@dansiegel Was the attached property PopupDialogLayout added to version 9.0.537?

@dansiegel
Copy link
Member

PopoutDialogLayout is only available in the Popup Plugin which is available on the Prism NuGet feed for Commercial Plus license holders

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants