私はUserControlを持っています.DataTemplateのListViewコントロールがDataTemplateにあります。CheckBoxは、ShowCheckBoxというUserControlのプロパティに基づいて表示するよう定義しています。 x:Name="This"
そしてより:WPTのUserControlでDataTemplateのコントロールを表示/非表示
<Visibility={Binding ElementName=This, Path=MyProperty}>
あなたの財産と仮定すると、これは、ユーザーコントロールを呼び出し
<UserControl x:Class="WpfApplication15.UserControl2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<ListView>
<ListView.View>
<GridView>
<GridViewColumn Header="Name" Width="500">
<GridViewColumn.CellTemplate>
<DataTemplate>
<CheckBox Visibility="{Binding ??? this.ShowCheckBox ??? }" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
</UserControl>
大変感謝しています! – unruledboy
「必要」という言葉は、むしろ不正確です... –
私はそう思います...... – Ray