2
我想通过改变IconToShow propery和绑定(编程)来改变图像,当项目按下时。Xamarin Forms ListView onpressing事件
如何触发OnPressed事件?
<ListView x:Name="listView" ItemSelected="OnItemSelected" ItemsSource="{Binding MainMenuList}" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" IsVisible="{Binding MenuStyle, Converter={StaticResource not}" SeparatorColor="Blue">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<ViewCell.View>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10" />
<ColumnDefinition Width="30" />
<ColumnDefinition Width="10" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Image Source="{Binding IconToShow}" Grid.Row="0" Grid.Column="1"/>
<Label Text="{Binding Title}" Grid.Row="0" Grid.Column="3"/>
</Grid>
</ViewCell.View>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
by Onpressing you mean tab and keep the finger in the cell?或OnClick?只需点击并移除手指? –
我的意思是选项卡,并保持手指在单元格@MarioGalván –