public void MediaQueryChanged(MediaQueryArgs args) { MatchesChanged.InvokeAsync(args.Matches); InternalMedia = args; if (Matched != null || Unmatched != null) { StateHasChanged(); } }
public void MediaQueryChanged(MediaQueryArgs args) { bool byMediaProperties(MediaQueryCache q) => q.Value.Media == args.Media; var cache = mediaQueries.Find(byMediaProperties); foreach (var item in cache.MediaQueries) { item.MediaQueryChanged(args); } }
public void MediaQueryChanged(MediaQueryArgs args) { // cache must be compared by actual value, not RequestedMedia when invoked from JavaScript // DOM Media value my be different that the initally requested media query value. var cache = mediaQueries.Find(q => q.Value.Media == args.Media); // Dispatch events to all subscribers foreach (var item in cache.MediaQueries) { item.MediaQueryChanged(args); } }