Is there any way to show a Popup in Windows 8 Metro centered?
Setting VerticalAlignment
and HorizontalAlignment
to "Center", and VerticsalOffset
and HorizontalOffset
to 0 causes howing popup with left-up corner in the center of the screen.
Is there any way to do it nicely?
To make this problem harder, this popup has different size in snapped view, where is also should be centered.
Any thoughts?
Hope this helps, how about placing the popup in a canvas then manipulate the canvas...
XAML
C#
Just have fun trying...
I also added the following code to my xaml.cs (code behind) file:
(see the xaml I posted previously)
I then just wire up any test button's _Tapped event with the myPopup() function below.
I still haven't quite got the hang of Stackpanel to get the message centered, etc, but I'm getting there!
I put this at the end of the main Grid in my Xaml, after everything else so it's sure to come to the front.