Пример #1
0
 /// <summary>
 /// for the case of ContentPage, it sets key focus on AppBar's NavigationContent
 /// </summary>
 protected internal override void RestoreKeyFocus()
 {
     if (FocusManager.Instance.IsDefaultAlgorithmEnabled())
     {
         if (LastFocusedView)
         {
             FocusManager.Instance.SetCurrentFocusView(LastFocusedView);
         }
         else
         {
             if (AppBar != null)
             {
                 FocusManager.Instance.SetCurrentFocusView(AppBar.PassFocusableViewInsideIfNeeded());
             }
             else
             {
                 FocusManager.Instance.ClearFocus();
             }
         }
     }
 }
Пример #2
0
        public Page(AppBar appBar, View content = null) : base()
        {
            //AppBar and Content are located verically.
            var linearLayout = new LinearLayout();

            linearLayout.LinearOrientation = LinearLayout.Orientation.Vertical;
            Layout = linearLayout;

            //Page fills to parent by default.
            WidthResizePolicy  = ResizePolicyType.FillToParent;
            HeightResizePolicy = ResizePolicyType.FillToParent;

            if (appBar)
            {
                AppBar = appBar;
            }

            if (content)
            {
                Content = content;
            }
        }