Hi!
Is it possible to detect the actual drop-down position of the DropDownContent?
I'm trying to set the MaxHeight according to the total hight of the host (to avoid content beeing clipped when exceeding the boundaries of the browser, and insted get the vertical scroll-bars).
Currently I'm doing this by measuring how far down the DropDown control is on the page. For example:
This works fine, until the DropDownplacement changes from bottom to top (because we get further down on the page).
So I need a way to detect when the control chooses to display the dropdown contents above instead of below the control, so that I can calculate the proper MaxHeight of the dropdown. (And the "auto-positioning" feature is just fine, I don't want to force the dropdown above or below)
Currently, I'm adjusting the MaxHeight in the DropDownOpened event.
Thanks!
Jon
Is it possible to detect the actual drop-down position of the DropDownContent?
I'm trying to set the MaxHeight according to the total hight of the host (to avoid content beeing clipped when exceeding the boundaries of the browser, and insted get the vertical scroll-bars).
Currently I'm doing this by measuring how far down the DropDown control is on the page. For example:
Point
dropDownPos = ddDropDown.TransformToVisual(null).Transform(new Point());
double DropDownMaxHeight = Application.Current.Host.Content.ActualHeight - (dropDownPos.Y + ddDropDown.ActualHeight);This works fine, until the DropDownplacement changes from bottom to top (because we get further down on the page).
So I need a way to detect when the control chooses to display the dropdown contents above instead of below the control, so that I can calculate the proper MaxHeight of the dropdown. (And the "auto-positioning" feature is just fine, I don't want to force the dropdown above or below)
Currently, I'm adjusting the MaxHeight in the DropDownOpened event.
Thanks!
Jon