コード例 #1
0
        public void ActivateNestedNavigator(FrameworkElement focusElm)
        {
            IsEnabled = false;
            var nav = BlockNavigatorProperty.GetBlockNavigator(focusElm);

            nav.ParentNavigator = this;
            nav.IsEnabled       = true;

            OwnerElement.RaiseEvent(new RoutedEventArgs(BlockNavigatorProperty.NavigationExitEvent, OwnerElement));
            nav.OwnerElement.RaiseEvent(new RoutedEventArgs(BlockNavigatorProperty.NavigationEnterEvent, nav.OwnerElement));
        }
コード例 #2
0
        public static void OnDisableBlockNavigatorChanged(FrameworkElement a, bool value)
        {
            var nav = BlockNavigatorProperty.GetBlockNavigator(a);

            if (nav == null)
            {
                var elm = FindBlockNavigatorElement(a);
                nav = BlockNavigatorProperty.GetBlockNavigator(elm);
            }
            nav.IsEnabled        = !value;
            nav.ExplicitDisabled = value;
        }
コード例 #3
0
        public static void RegisterNestedNavigationBlock(FrameworkElement frameworkElement)
        {
            // register on parent navigator that is
            RegisterNavigationBlock(frameworkElement);

            var navigator = BlockNavigatorProperty.GetBlockNavigator(frameworkElement);

            if (navigator == null)
            {
                navigator           = CreateNavigator(frameworkElement);
                navigator.IsEnabled = false;
            }
            var parentNavigator = FindBlockNavigatorElement(frameworkElement);

            navigator.ParentNavigator = BlockNavigatorProperty.GetBlockNavigator(parentNavigator);
        }
コード例 #4
0
        public static void RegisterNavigationBlock(FrameworkElement frameworkElement)
        {
            var parentElement = FindBlockNavigatorElement(frameworkElement);
            var nav           = BlockNavigatorProperty.GetBlockNavigator(parentElement);

            if (nav == null)
            {
                nav           = CreateNavigator(parentElement);
                nav.IsEnabled = true;
            }

            // bugfix: The control will not be part of the correct hierarchy until it's fully loaded
            frameworkElement.Loaded += delegate {
                nav.OnAddBlock(frameworkElement);
            };
        }
コード例 #5
0
        public static void OnFocusableChanged(FrameworkElement a, bool value)
        {
            void f(FrameworkElement p)
            {
                var parent = FindBlockNavigatorElement(a);

                if (parent == a)
                {
                    parent = FindBlockNavigatorElement((FrameworkElement)a.Parent);
                }
                var nav = BlockNavigatorProperty.GetBlockNavigator(parent);

                if (value == false)
                {
                    nav._blocks.Remove(a);
                }
                else
                {
                    var point = a
                                .TransformToAncestor(parent)
                                .Transform(new Point(0, 0));
                    nav._blocks[a] = new Rect(
                        point.X,
                        point.Y,
                        a.ActualWidth,
                        a.ActualHeight
                        );
                }
            }

            if (a.IsLoaded)
            {
                f(a);
            }
            else
            {
                new Await(a, f).Loaded();
            }
        }