10
削除ボタンが含まれたWPF UserControlがあります.UserControl全体をCommandParameterとして渡したいと思います。wpf usercontrol、親コントロールにボタンのコマンドパラメータをバインド
現在、バインドはCommandParameter = "{Binding RelativeSource = {RelativeSource Self}}"に設定されていますが、これは私にボタンを与えますが、コントロール全体をどのように取得できますか?
誰でも助けてください。
乾杯、
アンディ
<UserControl x:Class="GTS.GRS.N3.Controls.LabelledTextBox"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100" />
<ColumnDefinition Width="155" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Label Name="label" HorizontalAlignment="Left" Width="96">Label</Label>
<TextBox Name="textBox" Grid.Column="1" />
<Button Grid.Column="2" Style="{DynamicResource CloseButton}" Command="{Binding RemoveCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}}" Visibility="{Binding RemoveVisible}"></Button>
</Grid>
</UserControl>