Bonjour à tous

Sur un projet WPF avec couche MVVM, je bataille sans trouver de solution sur une combobox dont la liste est faite de checkbox.

Dans cette liste, avant les items "checkbox", j'ai voulu rajouter 2 boutons pour avoir les fonctions "Tout sélectionner" et "Tout désélectionner".
Tout à l'air de fonctionner, sauf que les checkox de ma liste ne se mettent pas à jour quand je clique sur les boutons.
J'ai essayé pas mal de code dans tous les sens, j'ai fini par m'y perdre un peu.

Le code de la view :
Code xaml : 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
 
<Window x:Class="Toto.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
        mc:Ignorable="d"
        DataContext="{Binding Main, Source={StaticResource Locator}}">
 
    <!-- Fond d'écran -->
    <Grid>
        <ComboBox x:Name="MaListe" Height="18" Width=" 300">
            <ComboBox.Resources>
                <CollectionViewSource x:Key="cliste" Source="{Binding CList}" />
            </ComboBox.Resources>
            <ComboBox.ItemsSource>
                <CompositeCollection>
                    <ComboBoxItem>
                        <Button x:Name="allItems" Command="{Binding CListSelectAllCommand}">---  Tout sélectionner  ----</Button>
                    </ComboBoxItem>
                    <ComboBoxItem>
                        <Button x:Name="NoneItems" Command="{Binding CListUnSelectAllCommand}">---  Tout désélectionner  ----</Button>
                    </ComboBoxItem>
                    <CollectionContainer Collection="{Binding Source={StaticResource cliste}}" />
                </CompositeCollection>
            </ComboBox.ItemsSource>
            <ComboBox.ItemTemplate>
                <DataTemplate>
                    <CheckBox IsChecked="{Binding Selected}" Content="{Binding Nom}">
                        <!-- <i:Interaction.Triggers>
                            <i:EventTrigger EventName="Checked">
                                <cmd:EventToCommand Command="{Binding Path=DataContext.ItemsSelectedChangedCommand, RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type UserControl}}, Mode=Default}" />
                            </i:EventTrigger>
                            <i:EventTrigger EventName="Unchecked">
                                <cmd:EventToCommand Command="{Binding Path=DataContext.ItemsSelectedChangedCommand , RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type UserControl}}, Mode=Default}" />
                            </i:EventTrigger>
                        </i:Interaction.Triggers> -->
                    </CheckBox>
                </DataTemplate>
            </ComboBox.ItemTemplate>
        </ComboBox>
    </Grid>
</Window>

Le code du viewmodel associé :
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
63
64
65
66
67
 
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
 
namespace Toto.ViewModels
{
    public class CItem : INotifyPropertyChanged
    {
        public bool Selected { get; set; } = false;
        public string Nom { get; set; }
        public CItem(bool b, string s)
        {
            Selected = b;
            Nom = s;
        }
 
        public event PropertyChangedEventHandler PropertyChanged;
    }
    public class MainViewModel : ViewModelBase
    {
        public ObservableCollection<CItem> CList { get; set; }
 
        public RelayCommand CListSelectAllCommand { get; private set; }
        public RelayCommand CListUnSelectAllCommand { get; private set; }
 
        public MainViewModel()
        {
            CListSelectAllCommand = new RelayCommand(ExecuteCListSelectAll);
            CListUnSelectAllCommand = new RelayCommand(ExecuteCListUnSelectAll);
 
            ObservableCollection<CItem> l = new ObservableCollection<CItem>();
            for (int i=1; i<15; i++)
            {
                l.Add(new CItem(false, "Item " + i.ToString()));
            }
            CList = l;
            RaisePropertyChanged("CList");
        }
 
        private void ExecuteCListSelectAll()
        {
            foreach (CItem z in CList)
            {
                z.Selected = true;
                RaisePropertyChanged("Selected");
            }
            RaisePropertyChanged("CList");
        }
        private void ExecuteCListUnSelectAll()
        {
            foreach (CItem z in CList)
            {
                z.Selected = false;
            }
            RaisePropertyChanged("CList");
        }
 
    }
}
Lorsque je clique sur "Tout sélectionner", la liste dans le viewmodel a bien tous ses items de "Selected", mais ça ne se traduit pas dans la view.

NOTA : Même avec les fonctions "Tout sélectionner" et "Tout désélectionner", les items doivent rester sélectionnables/désélectionnables individuellement, dans la view, traduit directement dans la liste du viewmodel