带有返回值的导航

 

一、设置PageFunction

xmlns:src = "clr-namespace:类1的名字空间"

x:TypeArguments = "src:类1"

RemoveFromJournal = true

 

二、PageFunction中返回值

1.返回正常值

OnReturn(new ReturnArgs<类1>(new 类1()));

 

2.返回空值

OnReturn(null);

 

三、Page中导航到PageFunction

PageFunction01 pf = new PageFunction01();

pf.Return += (obj, arg){

  if(null == arg) {

    //some code

  }else{

    //arg.Result -- 返回的类

  }

}

NavigationService nav = NavigationService.GetNavigationService(this);

nav.Navigate(pf);

 

相关文章:

  • 2022-12-23
  • 2021-06-11
  • 2022-12-23
  • 2022-12-23
  • 2021-06-03
  • 2021-07-05
猜你喜欢
  • 2021-12-28
  • 2021-11-15
  • 2021-07-13
  • 2021-10-13
  • 2021-12-08
  • 2021-09-14
相关资源
相似解决方案