0

I need to get a popup in the VisualTree which is a sibling of Application.Current.RootVisual. Is there a way to do this?

I couldn't find a way for this at the moment.

I have tried to get the parent of the RootVisual but it don't have such.

            var frame = Application.Current.RootVisual as PhoneApplicationFrame;
            FrameworkElement fi = (FrameworkElement)VisualTreeHelper.GetParent(frame);

Thanks in advance

The DreAmeR
  • 145
  • 1
  • 7

1 Answers1

2

That was wrong approach.

Here is the correct one and it works like a champ:

            System.Collections.Generic.IEnumerable<Popup> popups = VisualTreeHelper.GetOpenPopups();
            Popup popup = popups.ElementAt(0);
The DreAmeR
  • 145
  • 1
  • 7