同じTreeViewItemContainer内TextBox
のSelectedItemに基づいてのVisibilityをバインドしたいと思います。ComboBox
バインディングにコンバーターを使用できると思いComboBox
ますが、バインディングのパラメーターとしてアイテムを送信する方法がわかりませんTextBox
。これはできますか?
<TreeView>
<TreeView.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<ComboBox Margin="2,0" Name="SkillSelectCB" ItemsSource="{Binding PotentialChildren}" />
<TextBox Margin="2,0" Width="50" Visibility="{Binding ??}" />
<Button Margin="2,0" Content="Add" />
</StackPanel>
</DataTemplate>
</TreeView.ItemTemplate>
</TreeView>
これは実際にはHierarchicalDataTemplateにあり、上記の例はごくわずかです。「追加」は、で選択されたものに基づいてButton
、ViewModelに新しい子を追加します。そして、可視性は、のSelectedItemのいくつかのプロパティに応じて変化します。TreeView
ComboBox
TextBox
ComboBox