Get open Popups

复制代码
 public  IEnumerable<Popup> GetOpenPopups()
        {
            return PresentationSource.CurrentSources.OfType<HwndSource>()
                .Select(h => h.RootVisual)
                .OfType<FrameworkElement>()
                .Select(f => f.Parent)
                .OfType<Popup>()
                .Where(p => p.IsOpen);
        }
复制代码

 

posted @   法的空间  阅读(239)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示