Caliburn Micro中的条件导航

时间:2013-09-18 07:32:52

标签: c# windows-phone-8 caliburn.micro

我在带有Bindable App Bar的Windows Phone 8应用程序中使用Caliburn Micro。 当我点击一个按钮时,如果我导航到与当前显示的页面相同的页面,我想要检查事件。

这里的代码是什么

if((Check with navigation service if you are navigating to the same page) == true)
    return;
else
    NavigationService.UriFor<ViewModel>().Navigate();

1 个答案:

答案 0 :(得分:0)

Caliburn Micro 通过ViewModels导航时,这应该可行...

if (this.GetType() != typeof(CurrentViewModel)) 
  { 
    NavigationService.UriFor<SomeNewViewModel>().Navigate();
  }
相关问题