private static Task <TViewModel> FindCloseTarget <TViewModel>(IRegion region, INavigationParameters parameters) where TViewModel : ReactiveViewModel { return(Observable.Start(() => region.Find <TViewModel>(vm => vm.CanClose(parameters)).FirstOrDefault(), RxApp.MainThreadScheduler).ToTask()); }