Skip to content
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

Maximum dropdown height is not screen aware #1162

Closed
pschimmel opened this issue Aug 22, 2023 · 2 comments
Closed

Maximum dropdown height is not screen aware #1162

pschimmel opened this issue Aug 22, 2023 · 2 comments
Labels
Milestone

Comments

@pschimmel
Copy link
Contributor

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.

@batzen
Copy link
Member

batzen commented Sep 6, 2023

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.

@batzen batzen added the Bug 🐞 label Sep 6, 2023
@batzen batzen added this to the 11.0 milestone Sep 6, 2023
@pschimmel
Copy link
Contributor Author

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 batzen changed the title Maximum dropdown height is not DPI aware Maximum dropdown height is not screen aware May 1, 2024
@batzen batzen closed this as completed in 3a954f6 May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants