GithubHelp home page GithubHelp logo

[BUG] When using iOS ModalPresentationStyles that can be automatically dismissed, navigation service gets out of sync & stops working with NavigationPage about prism HOT 2 CLOSED

Axemasta avatar Axemasta commented on May 29, 2024
[BUG] When using iOS ModalPresentationStyles that can be automatically dismissed, navigation service gets out of sync & stops working with NavigationPage

from prism.

Comments (2)

Axemasta avatar Axemasta commented on May 29, 2024

Prism iOS Modal Gif

Here is a little clip from my repro sample, you can see that as soon as I close the navigation page popover, the other commands stop working, the view model code is below & is incredibly simple:

public class MainViewModel : ViewModelBase
{
    public DelegateCommand NavigateCommand { get; }
    
    public DelegateCommand ModalCommand { get; }
    
    public DelegateCommand PopoverCommand { get; }
    
    public DelegateCommand NavPopoverCommand { get; }
    
    public MainViewModel(INavigationService navigationService) 
        : base(navigationService)
    {
        Title = "Main Page";

        NavigateCommand = new DelegateCommand(OnNavigate);
        ModalCommand = new DelegateCommand(OnModal);
        PopoverCommand = new DelegateCommand(OnPopover);
        NavPopoverCommand = new DelegateCommand(OnNavPopover);
    }

    private async void OnNavigate()
    {
        var nav = await navigationService.CreateBuilder()
            .AddSegment<AnotherViewModel>()
            .NavigateAsync();

        if (!nav.Success)
        {
            Debugger.Break();
        }
    }
    
    private async void OnModal()
    {
        var navParams = new NavigationParameters()
        {
            { KnownNavigationParameters.UseModalNavigation, false },
        };

        var nav = await navigationService.CreateBuilder()
            .AddNavigationPage(true)
            .AddSegment<AnotherViewModel>()
            .WithParameters(navParams)
            .NavigateAsync();

        if (!nav.Success)
        {
            Debugger.Break();
        }
    }
    
    private async void OnPopover()
    {
        var nav = await navigationService.CreateBuilder()
            .AddSegment<PopoverViewModel>(true)
            .NavigateAsync();

        if (!nav.Success)
        {
            Debugger.Break();
        }
    }

    private async void OnNavPopover()
    {
        var nav = await navigationService.CreateBuilder()
            .AddNavigationPage(true)
            .AddSegment<PopoverViewModel>()
            .NavigateAsync();

        if (!nav.Success)
        {
            Debugger.Break();
        }
    }
}

from prism.

dansiegel avatar dansiegel commented on May 29, 2024

closed by #3072

from prism.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.