我想将我的项目转换为MVVM模式,我有最后一件事,我不知道如何转换。这件事是我的listview与事件MouseDoubleClick,我不知道在哪里做绑定。< / p>
那是在我的XAML中:
<ListView Background="Gray" Name="Bibliotheque" SelectedItem="{Binding SelectedItemListView}" Grid.Column="1" Grid.Row="0" ItemsSource="{Binding ItemSourceListView}">
<ListView.View>
<GridView>
<GridViewColumn Header="Musique" Width="Auto">
<GridViewColumn.CellTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Image Grid.Column="0" Source="{Binding Musique}"/>
<TextBlock Grid.Column="1"
Text="{Binding NameMusique}"
HorizontalAlignment="Center" VerticalAlignment="Center">
</TextBlock>
</Grid>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Header="Artiste" Width="100" DisplayMemberBinding="{Binding Artiste}"/>
<GridViewColumn Header="DURATION" Width="100" DisplayMemberBinding="{Binding Duration}"/>
<GridViewColumn Header="Album" Width="150" DisplayMemberBinding="{Binding Album}"/>
</GridView>
</ListView.View>
</ListView>
如果有人有想法,我会看到并测试很多东西,但仍然无效。