2

Closed

ArgumentException during ArrangePlacement in Open HostDialog

description

I believe that we can run into issue because Popup is not yet visible when we're trying to call TransformToVisual in
      public void Open() {
            if(isOpen)
                return;
            isOpen = true;

            if(currentPage.ApplicationBar != null) {
                DisableAppBar();
            }

            ArrangePlacement();


            currentPage.BackKeyPress += CurrentPageBackKeyPress;
            currentPage.OrientationChanged += CurrentPageOrientationChanged;

            hostPopup.IsOpen = true;
        }
maybe we should call ArrangePlacement after setting IsOpen to true.

There is also another possibility that currentPage ArrangePlacement is not yet visible
        void ArrangePlacement() {
            maskingLayer.Dispatcher.BeginInvoke(() => {
                var placement = new ElementPlacement {
                    Transform = (Transform)currentPage.TransformToVisual(null),
                    Orientation = currentPage.Orientation,
                };

                elementPlacementAnimator.AnimateTo(placement);
            });
        } 
Closed Jan 6 at 6:51 PM by EisenbergEffect
Fixed.

comments

tibel wrote Jan 4 at 10:35 PM

Should be fixed.

Used solution from SafeTransformToVisual() from http://phone.codeplex.com/