-
Notifications
You must be signed in to change notification settings - Fork 677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DisplayInformation exception in WinUI3 preview4 #4228
Comments
DisplayInformation.GetForCurrentView() is no longer supported in WinUI 3 in Desktop. You should use XamlRoot's RasterizationScale |
Will those unsupported classes removed from public API? |
Some APIs belong to WinUI and Reunion projects (e.g. Microsoft.*), others belong to the UWP Platform that ships with the Windows 10 OS. For example, the Windows.Graphics.Display.DisplayInformation works well in UWP apps. We can't remove these APIs. But we do plan to remove the WinUI APIs that don't work from the supported versions (e.g. Reunion 0.5). For example, given Reunion 0.5 will support only WinUI 3 in Desktop, we should remove the Dispatcher,CoreDispatcher, Current, and CoreWindow properties from the Microsoft.UI.Xaml.Window class. Does this make sense to you? |
@marb2000 How shall I access the current view if |
@marb2000, is there suggested replacement for DisplayInformation.ScreenHeightInRawPixels property? I did not find it in this document. |
@sigmarsson The answer depends on what you needed the current view for. For the TitleBar in your example, does this help? More generally, hopefully the answer can be found in this list: If you're having concerns and this doesn't address them, please open a new issue. |
@BorzillaR If you want to get monitor info to replace ScreenHeightInRawPixels, you can try using MonitorFromWindow to get the HMONITOR and plug that into GetMonitorInfoW. If this doesn't work for what you need, please open a new issue and we'll get it sorted out. |
Since preview 4 the following code is throwing an exception
Windows.Graphics.Display.DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel
Is this a bug, or is there any way round?
The text was updated successfully, but these errors were encountered: