You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
I found a potential issue in the definition of the maximum height of a dropdown of the DropDown buttons.
The dependency property is defined as follows:
public static readonly DependencyProperty MaxDropDownHeightProperty = DependencyProperty.Register(nameof(MaxDropDownHeight), typeof(double), typeof(DropDownButton), new PropertyMetadata(SystemParameters.PrimaryScreenHeight / 3.0));
As far as I know, the SystemParameters.PrimaryScreenHeight does not consider DPI settings of the monitors.
In my opinion it is also questionably to use the height of the primary screen as the application could be shown on a different screen with totally different settings.
The text was updated successfully, but these errors were encountered:
Indeed.
It revert felt right to use the primary screen, regardless of the DPI issue.
But i never found a better way to define a reasonable default.
Will think about it again.
Indeed, I also had no better (simple) idea to what to set it to something meaningful.
For now, I just set the max height to a very large number so that the size is only limited by the screen boundaries.
This fixes my immediate problem that a dropdown with a large number of items in it always show the scrolling arrows when opened.
batzen
changed the title
Maximum dropdown height is not DPI aware
Maximum dropdown height is not screen aware
May 1, 2024
Hi!
I found a potential issue in the definition of the maximum height of a dropdown of the DropDown buttons.
The dependency property is defined as follows:
public static readonly DependencyProperty MaxDropDownHeightProperty = DependencyProperty.Register(nameof(MaxDropDownHeight), typeof(double), typeof(DropDownButton), new PropertyMetadata(SystemParameters.PrimaryScreenHeight / 3.0));
As far as I know, the SystemParameters.PrimaryScreenHeight does not consider DPI settings of the monitors.
https://learn.microsoft.com/en-us/dotnet/api/system.windows.systemparameters.primaryscreenheight?view=windowsdesktop-7.0
In my opinion it is also questionably to use the height of the primary screen as the application could be shown on a different screen with totally different settings.
The text was updated successfully, but these errors were encountered: