我有一个ContentControl
从左到右的 a Button
,分区和 a ComboBox
。我希望ComboBox
下拉菜单与控件的左侧对齐,而不是ComboBox
. 我收到了一个代码中的方法,但我想知道它是否可以在 xaml 中完成。
这给了我控件的名称:
ToolTip="{Binding Path=Name, RelativeSource={RelativeSource FindAncestor, AncestorLevel=2, AncestorType={x:Type Control}}}"
但我想引用控件:
Placement="Bottom" PlacementTarget="{Binding ElementName=[Fancy-Smancy xaml goes here!]}"
有什么想法吗?