private void SetItemFilterAndNavigateNext(CommandButtonDescriptor button) { using (IScopedFlowManagerService flowManagerService = App.ServiceProvider.GetRequiredService <IScopedFlowManagerService>()) { flowManagerService.CopyFlowItems(); flowManagerService.SetFlowDataCacheItem ( typeof(FilterLambdaOperatorParameters).FullName, this.getItemFilterBuilder.CreateFilter ( this.FormSettings.ItemFilterGroup, typeof(TModel), this.entity ) ); flowManagerService.Next ( new CommandButtonRequest { NewSelection = button.ShortString } ); } }
private async void Start() { using (IScopedFlowManagerService flowManagerService = App.ServiceProvider.GetRequiredService <IScopedFlowManagerService>()) { await flowManagerService.Start(); } }
public void DataFromTheSameScopeMustMatch() { IScopedFlowManagerService scopedFlowManagerService1 = serviceProvider.GetRequiredService <IScopedFlowManagerService>(); scopedFlowManagerService1.SetFlowDataCacheItem("A", new List <string> { "First", "Second" }); object aList = scopedFlowManagerService1.GetFlowDataCacheItem("A"); Assert.Equal("Second", ((List <string>)aList)[1]); }
public void DataFromDifferentScopesCanBeDifferent() { IScopedFlowManagerService scopedFlowManagerService1 = serviceProvider.GetRequiredService <IScopedFlowManagerService>(); IScopedFlowManagerService scopedFlowManagerService2 = serviceProvider.GetRequiredService <IScopedFlowManagerService>(); scopedFlowManagerService1.SetFlowDataCacheItem("A", new List <string> { "First", "Second" }); Assert.Empty(scopedFlowManagerService2.FlowManager.FlowDataCache.Items); Assert.Equal("Second", ((List <string>)scopedFlowManagerService1.FlowManager.FlowDataCache.Items["A"])[1]); }
protected Task NavigateNext(CommandButtonDescriptor button) { using (IScopedFlowManagerService flowManagerService = App.ServiceProvider.GetRequiredService <IScopedFlowManagerService>()) { flowManagerService.CopyFlowItems(); return(flowManagerService.Next ( new CommandButtonRequest { NewSelection = button.ShortString } )); } }
private async void ListView_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (e.CurrentSelection.Count != 1) { return; } if (!(e.CurrentSelection.First() is NavigationMenuItemDescriptor item)) { return; } if (item.Active) { return; } DisposeCurrentPageBindingContext(Detail); using (IScopedFlowManagerService flowManagerService = App.ServiceProvider.GetRequiredService <IScopedFlowManagerService>()) { flowManagerService.CopyPersistentFlowItems(); await flowManagerService.NewFlowStart ( new Flow.Requests.NewFlowRequest { InitialModuleName = item.InitialModule } ); } void DisposeCurrentPageBindingContext(Page detail) { if (detail is not NavigationPage navigationPage) { return; } if (navigationPage?.RootPage.BindingContext is not IDisposable disposable) { return; } disposable.Dispose(); } }