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