Как отключить событие click для элемента списка, который привязан?
Мне удалось установить для элементов видимость false, но этого недостаточно, даже если элемент невидим, он все равно вызывает событие при нажатии на эту область.,Это мой предмет:
<DataTemplate x:Key="stolTemplate1">
<Grid Visibility="{Binding konobar, Converter={StaticResource IsItMyTable}}" Height="155" Width="155">
<Grid.Background>
<ImageBrush ImageSource="{Binding suma, Converter={StaticResource tablePictureConverter}}"/>
</Grid.Background>
<Grid Height="27" Width="Auto" Visibility="{Binding suma, Converter={StaticResource IsItMyTable2}}" VerticalAlignment="Bottom" Margin="45,0,45,128">
<Grid.Effect>
<DropShadowEffect/>
</Grid.Effect>
<Grid.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="{DynamicResource tipkeNarPlaG1Color}" Offset="0"/>
<GradientStop Color="#FF1E4D57" Offset="1"/>
</LinearGradientBrush>
</Grid.Background>
<Label Content="{Binding suma}" Foreground="White" HorizontalAlignment="Center" FontWeight="Bold" FontSize="16">
<Label.Effect>
<DropShadowEffect/>
</Label.Effect>
</Label>
</Grid>
<Label x:Name="label" Content="{Binding broj_stola}" HorizontalAlignment="Stretch" Margin="0" VerticalAlignment="Stretch" Height="Auto" Width="Auto" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Foreground="Black" FontSize="26.667" Background="{x:Null}" FontWeight="Bold"/>
</Grid>
</DataTemplate>
Эта часть:
<Grid Visibility="{Binding konobar, Converter={StaticResource IsItMyTable}}"
Вызывает эту часть:
Private Function IValueConverter_Convert(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.Convert
If value = Globals.konobar Or value = 0 Then Return Visibility.visible
Return Visibility.Collapsed
End Function
Вместо видимости я хочу, чтобы это было IsEnabled = False /Верно.
Достигну ли я этого через ItemTemplate или, возможно, через ItemContainer?