<ListView Grid.Row="1" Margin="10" Name="lvRegistersConfig" ItemsSource="{Binding registers}">
<ListView.Resources>
<local:BoolToVisibility x:Key="BTVConverter"/>
</ListView.Resources>
<ListView.View>
<GridView>
<local:GridViewColumnExt Header="Register Name" Width="100" Visibility="{Binding Vis, Converter={StaticResource BTVConverter}}" >
<local:GridViewColumnExt.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}" Visibility="{Binding Vis, Converter={StaticResource BTVConverter}}"/>
</DataTemplate>
</local:GridViewColumnExt.CellTemplate>
</local:GridViewColumnExt>
</GridView>
</ListView.View>
</ListView>
GridViewColumnExt is a class that inherits from GridViewColumn and adds the Visibility property.
My ListView's ItemsSource as you may see, is set to be the registers ObservableCollection. Register class has a property of type bool named Vis. It all works fine for the TextBox, but from the GridViewColumnExt don't, i think i cannot reach the collection and bind to the specific object.
I am not sure what's the DataContext for the GridViewColumn, i saw that i cannot set it. I need a hint on this, how can my GridViewColumn see the Vis property from the Register object in the registers ObservableCollection ?