public async Task InitializeAsync() { _ActivityCount += 1; var resolutions = new HashSet <(int x, int y)>(); await Task.Run(() => { var devmode = new DEVMODE(); for (int i = 0; DEVMODE.EnumDisplaySettings(null, i, ref devmode); i++) { resolutions.Add((devmode.dmPelsWidth, devmode.dmPelsHeight)); } }); ResolutionItems = new ObservableCollection <Tuple <int, int> >(resolutions .Select(r => Tuple.Create(r.x, r.y))); _Table = await _LoadOptionsFileAsync(); _RefreshFromTable(_Table); _ActivityCount -= 1; }
public static extern bool EnumDisplaySettings(string deviceName, int modeNum, ref DEVMODE devMode);