Closed pschimmel closed 2 months ago
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.
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.