Calling all developers! We invite you to provide your input on Feature Experimentation by completing this brief survey.

 

Per Nergård
Dec 14, 2013
  2215
(0 votes)

Get a list of all display resolutions

Recently I needed to get a list of all display resolutions. I couldn’t find any info about it so I struggled a bit. This post is a note to self if I ever need to do it again. Hopefully it can be of use for someone else.

private IEnumerable<IDisplayResolution> GetDisplayResolutions()
{
  ServiceLocationHelper helper = new ServiceLocationHelper(ServiceLocator.Current);
  DisplayResolutionService resolutionservice =      helper.Advanced.GetInstance<DisplayResolutionService>();
   return resolutionservice.Resolutions;
}
Dec 14, 2013

Comments

Please login to comment.
Latest blogs
Level Up with Optimizely's Newly Relaunched Certifications!

We're thrilled to announce the relaunch of our Optimizely Certifications—designed to help partners, customers, and developers redefine what it mean...

Satata Satez | Jan 14, 2025

Introducing AI Assistance for DBLocalizationProvider

The LocalizationProvider for Optimizely has long been a powerful tool for enhancing the localization capabilities of Optimizely CMS. Designed to ma...

Luc Gosso (MVP) | Jan 14, 2025 | Syndicated blog

Order tabs with drag and drop - Blazor

I have started to play around a little with Blazor and the best way to learn is to reimplement some old stuff for CMS12. So I took a look at my old...

Per Nergård | Jan 14, 2025

Product Recommendations - Common Pitfalls

With the added freedom and flexibility that the release of the self-service widgets feature for Product Recommendations provides you as...

Dylan Walker | Jan 14, 2025