0

、パーティション、およびのContentControl左から右に構成されています。ドロップダウンを、の左側ではなく、コントロールの左側に揃えたいと思います。コードでメソッドを受け取りましたが、xamlで実行できるかどうか疑問に思いました。ButtonComboBoxComboBoxComboBox

これにより、コントロールの名前がわかります。

ToolTip="{Binding Path=Name, RelativeSource={RelativeSource FindAncestor, AncestorLevel=2, AncestorType={x:Type Control}}}"

しかし、私はコントロールへの参照が欲しいです:

Placement="Bottom" PlacementTarget="{Binding ElementName=[Fancy-Smancy xaml goes here!]}"

何かご意見は?

4

1 に答える 1

0

と:を指定するAncestorLevelと、RelativeSourceが正常に機能することがわかります。AncestorType

Placement="Bottom" 

PlacementTarget="{Binding RelativeSource={RelativeSource FindAncestor, AncestorLevel=2, AncestorType={x:Type Grid}}}"
于 2009-12-02T18:38:35.797 に答える