0

i want to convert my project to an MVVM Pattern, and i have this last thing, i don't know how to convert in. This thing is my listview with the event MouseDoubleClick, i dunno where to do the binding.

That's in my 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>

If anyone have an idea, i have see and test a lots of thing, and still doesn't work.

Raphael Teyssandier
  • 1,722
  • 2
  • 13
  • 25
  • 1
    duplicate of http://stackoverflow.com/questions/1293530/how-to-bind-a-command-in-wpf-to-a-double-click-event-handler-of-a-control and http://stackoverflow.com/questions/5545187/wpf-how-to-bind-a-command-to-the-listboxitem-using-mvvm – Breeze Nov 26 '15 at 22:05
  • I didn't saw the second, and i can' t use a library, so i'll try thé second. – Raphael Teyssandier Nov 26 '15 at 22:11
  • did you look at the second answer of the first question? It is far better than the accepted one – Breeze Nov 26 '15 at 22:32

0 Answers0