【发布时间】:2019-02-15 17:24:15
【问题描述】:
当我在短时间内多次单击按钮时,每次都会调用该方法并且我的应用程序崩溃(当代码尝试导航到另一个页面时)。此问题仅在 Xamarin.Android 中出现(iOS 处理双击)
public bool IsBusy { get; set; }
private DelegateCommand<string> _eventDetailsCommand;
public DelegateCommand<string> EventDetailsCommand => _eventDetailsCommand ?? (_eventDetailsCommand = new DelegateCommand<string>(EventDetails, (x) => !IsBusy));
private void EventDetails(string obj)
{
IsBusy = true;
await _navigationService.NavigateAsync("AnotherPage");
IsBusy = false;
}
Xamarin.Android
棱镜:7.1.0.172(预)
PropertyChanged.Fody (2.2.6):
【问题讨论】:
-
即使很明显这里有什么问题,您也应该编辑您的问题以扩展究竟是什么不起作用和您希望您的代码做什么...
-
是的,你是对的
标签: xamarin.forms xamarin.android prism