Bonjour,
Je développe une application en wpf;
Voila la partie de code me posant problème :


Presenter (ViexModel) :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
    public class ModifTourPresenter : BasePresenter
    {
        public ModifTourPresenter()
        {
            Title = "Gestion des tours";
            ListTourDb = BOLUnitOfWork.Tours.AllTours();
            ListTourAffiche = ListTourDb;
            listNom = new List<string>();
            foreach (var membre in BOLUnitOfWork.Membres.AllMember().OrderByDescending(m => m.TourCount))
            {
                listNom.Add(membre.Nom);
            }
        }      
 
    }

XAML :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="50"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="2*"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>
 
        <TextBlock Text="{Binding Title}" Grid.Row="0" Style="{StaticResource PageTitle}"></TextBlock>
        <ListView Grid.Row="1" ItemsSource="{Binding ListTourAffiche}" SelectedItem="{Binding SelectedTour, Mode=TwoWay}" BorderThickness="0" HorizontalAlignment="Center" VerticalAlignment="Top" Width="510" Height="150" Background="#83DFFF" x:Name="ListViewTour">
            <ListView.View>
                <GridView>
                    <GridViewColumn Width="80" Header="Date" DisplayMemberBinding="{Binding Date, StringFormat={}{0:MM/dd/yyyy}}" />
                    <GridViewColumn Width="100" Header="Nom" DisplayMemberBinding="{Binding Membre.Nom}"/>
                    <GridViewColumn Width="100" Header="Prénom" DisplayMemberBinding="{Binding Membre.Prenom}" />
                    <GridViewColumn Width="100" Header="Discipline" DisplayMemberBinding="{Binding Tarif.Nom}"/>
                    <GridViewColumn Width="80" Header="Durée" DisplayMemberBinding="{Binding Duree}"/>
                </GridView>
            </ListView.View>
        </ListView>
        <Grid Margin="10, 30,10,10" Grid.Row="2">
            <Grid.RowDefinitions>
                <RowDefinition Height="auto"></RowDefinition>
                <RowDefinition Height="auto"></RowDefinition>
                <RowDefinition Height="auto"></RowDefinition>
                <RowDefinition Height="auto"></RowDefinition>
                <RowDefinition Height="auto"></RowDefinition>
                <RowDefinition Height="auto"></RowDefinition>
                <RowDefinition Height="*"></RowDefinition>
                <RowDefinition Height="auto"></RowDefinition>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="90"></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
            </Grid.ColumnDefinitions>
 
 
            <TextBlock Text="Date : "  Grid.Column="0" Grid.Row="0" Margin="3"/>
            <DatePicker x:Name="Date" Width="200" Grid.Column="1" Grid.Row="0" Margin="3" SelectedDate="{Binding SelectedTour.Date}"></DatePicker> 
 
            <TextBlock Text="Nom : " Grid.Column="0" Grid.Row="1"  Margin="3" />
            <ComboBox x:Name="Nom" ItemsSource="{Binding ListNom}" SelectedItem="{Binding SelectedTour.Membre.Nom}" Width="200" Grid.Column="1" Grid.Row="1" Margin="3" IsEditable="True"></ComboBox>
 
            <TextBlock Text="Prenom : " Grid.Column="0" Grid.Row="2" Margin="3" />
            <ComboBox x:Name="Prenom" SelectedItem="{Binding SelectedTour.Membre.Prenom}" Width="200" Grid.Column="1" Grid.Row="2" Margin="3" IsEditable="True"></ComboBox>
 
            <TextBlock Text="Discipline : " Grid.Column="0" Grid.Row="3" Margin="3" />
            <TextBox x:Name="Discipline" Width="200" Grid.Column="1" Grid.Row="3" Margin="3" Text="{Binding SelectedTour.Tarif.Nom}" />
 
            <TextBlock Text="Durée : " Grid.Column="0" Grid.Row="4" Margin="3"  />
            <TextBox x:Name="Durée" Width="200" Grid.Column="1" Grid.Row="4" Margin="3" Text="{Binding SelectedTour.Duree}" />
 
 
 
            <Button Content="Modifier !" Grid.Column="3" Height="80" Grid.Row="0" Grid.RowSpan="6" Margin="10,0,10,10" VerticalAlignment="Top" Style="{StaticResource MyButton}" />
            <Button Content="Supprimer !" Grid.Column="3"  Grid.Row="0" Grid.RowSpan="6" Margin="10, 90, 10, 0" Style="{StaticResource MyButton}" />
            <TextBlock TextAlignment="Center" x:Name="validat" Height="50" Text="" Foreground="Red" Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="3" />
 
        </Grid>
        <Button Content="Retour menu" Style="{StaticResource MyButton}" FontSize="25" Grid.Row="3" Grid.Column="0" Margin="20" Grid.ColumnSpan="3" VerticalAlignment="Bottom" Height="80" Click="BackButtonClick" />
    </Grid>

Mon problème :
Quand on sélectionne un item de la listView, le Binding fonctionne bien et s'affiche dans les textBlock et comboBox en dessous.
Par contre si je modifie le nom dans la comboBox ça me change toute les ligne de la listView qui avais le même nom...
Par exemple si dans la listView j'ai deux personnes qui s'appelle Durant et que je clique sur un des deux pour le modifier, au moment ou je change le nom (Sur la comboBox), les deux Durant de la listView seront modifié ...

Merci d'avance pour votre aide !
Marc