Example #1
0
        protected void UpdateCustomProvidersChildrenStructure()
        {
            var currentCustom  = WrappedFragmentProvider.GetNavigatedChildProviders();
            var storedWrappers = Navigation.GetCustomChildren();
            var storedCustom   = storedWrappers.Select(x => x.WrappedFragmentProvider).ToArray();

            foreach (var provider in storedWrappers)
            {
                if (!currentCustom.Contains(provider.WrappedFragmentProvider))
                {
                    HandleChildComponentRemoved(provider.Component);
                }
            }

            foreach (IRawElementProviderFragment child in currentCustom)
            {
                if (!storedCustom.Contains(child))
                {
                    var customComponent = new UserCustomComponent(child, this);
                    HandleChildComponentAdded(customComponent);
                }
            }
        }
        protected void UpdateCustomProvidersChildrenStructure()
        {
            var currentWrappers = WrappedFragmentProvider.GetNavigatedChildProviders();

            var storedWrappers = Navigation.GetChildren().OfType <FragmentProviderWrapper> ().ToArray();
            var storedCustom   = storedWrappers.Select(x => x.WrappedFragmentProvider).ToArray();

            foreach (var provider in storedWrappers)
            {
                if (!currentWrappers.Contains(provider.WrappedFragmentProvider))
                {
                    TerminateComponentProvider(provider.Component);
                }
            }

            foreach (IRawElementProviderFragment child in currentWrappers)
            {
                if (!storedCustom.Contains(child))
                {
                    var userCustomComponent = new UserCustomComponent(child, this);
                    InitializeComponentProvider(userCustomComponent);
                }
            }
        }