コード例 #1
0
        public static void ShowAnchorPopup(this ContentView view, View popup, AnchorPopup parameters)
        {
            if (!view.IsAbsoluteLayout() || popup == null || parameters == null || parameters.AnchorView == null)
            {
                return;
            }

            var layout = (AbsoluteLayout)((ContentView)view).Content;

            layout.DisableAllBut(parameters.AnchorView);
            layout?.ShowAnchorLayout(popup, parameters);
        }
コード例 #2
0
        public static void ShowAnchorPopup(this Page page, View popup, AnchorPopup parameters)
        {
            if (popup == null || parameters == null || parameters.AnchorView == null)
            {
                return;
            }

            var layout = page.GetAbsoluteLayout();

            layout.DisableAllBut(parameters.AnchorView);
            layout?.ShowAnchorLayout(popup, parameters);
        }
コード例 #3
0
        private static void ShowAnchorLayout(this AbsoluteLayout layout, View popup, AnchorPopup parameters)
        {
            if (layout != null)
            {
                popup.AutomationId = "CorePopupAutomationId";
                if (parameters.UseParentBindingContext)
                {
                    popup.BindingContext = layout.BindingContext;
                }

                AbsoluteLayout.SetLayoutBounds(popup, parameters.ToAbsoluteRectange(popup));
                layout.Children.Add(popup);

                popup.ScaleTo(0.99, 200).ContinueWith(async(t) =>
                {
                    await popup.ScaleTo(1, 200);
                });
            }
        }