I have a xaml structure, that looks like this:
<StackPanel>
<TextBox>
<TextBox.Style>
<Style TargetType="{x:Type TextBox}">
<Setter Property="Height" Value="200" />
</Style>
</TextBox.Style>
</TextBox>
<ToolBarPanel Orientation="Horizontal">
<Button Content="Funky stuff" Command="{Binding Query}" CommandParameter="{what to type in here?}" />
</ToolBarPanel>
</StackPanel>
如果用户在
ToolBarPanel
下单击Button
,我希望将TextBox
的内容作为CommandParameter
传递。那么如何找到这个元素?