Exemplo n.º 1
0
        private static FrameworkElement FindNavigatorElement(FrameworkElement elm, BlockNavigator self = null)
        {
            var searchElm = elm;

            while (true)
            {
                if (searchElm.Parent == null)
                {
                    break;
                }
                if ((bool)searchElm.GetValue(BlockNavigator.NestedNavigationProperty) == true)
                {
                    var nav = BlockNavigator.GetBlockNavigator(searchElm);
                    if (self != null && nav != self)
                    {
                        searchElm = (FrameworkElement)searchElm.Parent;
                        continue;
                    }
                    return(searchElm);
                }
                searchElm = (FrameworkElement)searchElm.Parent;
            }
            return(searchElm);
        }
Exemplo n.º 2
0
 private static void SetBlockNavigator(UIElement element, BlockNavigator value = null)
 {
     element.SetValue(BlockNavigatorProperty, value ?? new BlockNavigator(element));
 }