示例#1
0
        void CheckShadow(Page page, bool pushed = false)
        {
            IReadOnlyList <Page> stack = Element?.Navigation?.NavigationStack;

            if (pushed)
            {
                bool showShadow = stack?.Count > 1 ||
                                  TitleViewExtensions.GetIsShadowVisible(page);
                NavigationBar.Layer.ShadowOpacity = showShadow ? 0.5f : 0;
            }
            else
            {
                UpdateShadowOpacityOnPop(stack, page);
            }
        }
示例#2
0
        void UpdateShadowOpacityOnPop(IReadOnlyList <Page> stack, Page page = null)
        {
            if (stack != null && stack.Count <= 2)
            {
                bool shadowPropertyValue = false;
                if (stack.Count > 1)
                {
                    Page newPage = stack[stack.Count - 2];
                    shadowPropertyValue = TitleViewExtensions.GetIsShadowVisible(newPage);
                }

                bool hideShadow =
                    (page != null && stack?.Last <Page>() == page) &&
                    !shadowPropertyValue;
                NavigationBar.Layer.ShadowOpacity = hideShadow ? 0 : 0.5f;
            }
        }
示例#3
0
 public MainPage()
 {
     InitializeComponent();
     TitleViewExtensions.SetIsShadowVisible(this, false);
 }