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);
        }

 

相关文章:

  • 2022-02-27
  • 2021-09-22
  • 2021-06-25
  • 2022-12-23
  • 2021-04-05
  • 2021-09-17
  • 2021-10-20
  • 2021-09-17
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-12
  • 2021-06-02
  • 2022-01-07
  • 2021-06-10
  • 2021-08-29
相关资源
相似解决方案