WPF ComboBox弹出窗口放置:底部并且对齐到右边缘 [英] WPF ComboBox popup placement : Bottom and aligned to the right edge
问题描述
我尝试使用非标准下拉列表创建 ComboBox
。基本上,我希望下拉菜单低于 ComboBox
,但是与 ComboBox
的右边缘对齐,而不是
一个正常的 ComboBox
看起来像:
我想要的:
我试图在我的 ComboBox 模板中使用
Popup.PlacementMode
code>,但没有一个可能的值似乎做我想要的。有没有简单的方法,最好是纯XAML?
当我打开Expression Blend时,几秒钟内的解决方案:
< Popup Placement =LeftVerticalOffset ={TemplateBinding ActualHeight}
HorizontalOffset ={TemplateBinding ActualWidth}
有时这个应用程序比用手写xaml更有用,但不是那么频繁。
>
I'm trying to create a ComboBox
with a non-standard dropdown alignment. Basically, I want the dropdown to be below the ComboBox
, but aligned with the right edge of the ComboBox
instead of the left edge.
What a normal ComboBox
looks like:
What I want:
I tried to play with the Popup.PlacementMode
property in the template of my ComboBox
, but none of the possible values seem to do what I want. Is there a simple way to do it, preferably in pure XAML?
When I opened Expression Blend, I have come up with the solution within a few seconds:
<Popup Placement="Left" VerticalOffset="{TemplateBinding ActualHeight}"
HorizontalOffset="{TemplateBinding ActualWidth}"
Sometimes this application is more useful than writing xaml by hands, but not so often.
这篇关于WPF ComboBox弹出窗口放置:底部并且对齐到右边缘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!