0

Application.Current.RootVisual の兄弟である VisualTree でポップアップを取得する必要があります。これを行う方法はありますか?

現時点では、これを行う方法を見つけることができませんでした。

RootVisual の親を取得しようとしましたが、そのようなものはありません。

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

前もって感謝します

4

1 に答える 1

2

それは間違ったアプローチでした。

これが正しいもので、チャンピオンのように機能します。

            System.Collections.Generic.IEnumerable<Popup> popups = VisualTreeHelper.GetOpenPopups();
            Popup popup = popups.ElementAt(0);
于 2012-07-04T11:57:26.637 に答える