Exemplo n.º 1
0
 public void Dispose()
 {
     if (_scopedProvider != null)
     {
         _scopedProvider.Dispose();
         _scopedProvider = null;
     }
 }
Exemplo n.º 2
0
        private static INavigationService CreateNavigationService(IScopedProvider scope, Page page)
        {
            var navService = scope.Resolve <INavigationService>();

            switch (navService)
            {
            case IPageAware pa when pa.Page is null:
                pa.Page = page;
                break;

            case IPageAware pa1 when pa1.Page != page:
                return(CreateNavigationService(ContainerLocator.Container.CreateScope(), page));
            }

            page.SetValue(NavigationScopeProperty, scope);
            scope.IsAttached = true;
            page.SetValue(NavigationServiceProperty, navService);

            return(navService);
        }
Exemplo n.º 3
0
 public PrismServiceScope(IScopedProvider scopedProvider)
 {
     _scopedProvider = scopedProvider;
     ServiceProvider = new PrismServiceProvider(scopedProvider.CurrentScope);
 }