Prism RequestNavigate does not work

后端 未结 3 963
一生所求
一生所求 2021-01-02 18:40

In each view

public partial class View2 : UserControl, IRegionMemberLifetime, INavigationAware
{

  public bool KeepAlive
  {
    get { return false; }
  }

         


        
3条回答
  •  迷失自我
    2021-01-02 18:48

    Are you sure the view gets populated by the container?

    I would suggest you to provide a callback for the RequestNavigate method, so you'll be able to track what happens with your view thru the NavigationResult:

    regionManager.RequestNavigate
    (
        "Window1",
        new Uri("View2", UriKind.Relative),
        (NavigationResult nr) => 
        {
            var error = nr.Error;
            var result = nr.Result;
            // put a breakpoint here and checkout what NavigationResult contains
        }
    );
    

提交回复
热议问题