public Task <CloneDialogResult> ShowCloneDialog([AllowNull] IConnection connection) { var controller = uiProvider.Configure(UIControllerFlow.Clone, connection); var basePath = default(string); var repository = default(IRepositoryModel); controller.TransitionSignal.Subscribe(x => { var vm = x.View.ViewModel as IBaseCloneViewModel; vm.Done.Subscribe(_ => { basePath = vm?.BaseRepositoryPath; repository = vm?.SelectedRepository; }); }); uiProvider.RunInDialog(controller); var result = repository != null && basePath != null ? new CloneDialogResult(basePath, repository) : null; return(Task.FromResult(result)); }
IUIController CreateController(IConnection connection, ViewWithData data, Action <IView> onViewLoad) { var controller = uiProvider.Configure(data.MainFlow, connection, data); controller.TransitionSignal.Subscribe( loadData => { onViewLoad?.Invoke(loadData.View); IsBusy = false; }, () => { Pop(controller); Reload(); }); controller.Start(); return(controller); }
public IUIController Configure(UIControllerFlow flow, IConnection connection = null, ViewWithData data = null) => theRealProvider.Configure(flow, connection, data);