Bonjour

" Tour d'un coup" je me retrouve avec une erreur (dans le error list de visual studio) concernant mon fichier XAML.
Cette erreure est
Index was outside the bounds of the array
Mais lorsque je clique dessus, cela me souligne
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
        <ObjectDataProvider x:Key="odpComboBoxLeft"
                    ObjectType="{x:Type ODP:UgmProvider}" />
Je ne voit pas ou est l'erreur dans mon code XAML
- Cela ne m'empêche pas de compiler mais du coup je n'accède plus aux méthodes des mes ObjectDataProvider.
- Et le designer refuse de se charger tant que je n'ai pas résolu cette erreur.
Voicis le contenu de ma page XAML.

Merci pour votre aide

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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<UserControl x:Class="ADManagementIHM.Tabs.UGMTab"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ODP="clr-namespace:ADManagementIHM.ODP"
    xmlns:Styles="clr-namespace:ADManagementIHM.Styles"
    xmlns:Commons="clr-namespace:ADManagementIHM.Common">
    <UserControl.Resources>
        <ObjectDataProvider x:Key="odpComboBoxLeft"
                    ObjectType="{x:Type ODP:UgmProvider}" />
        <ObjectDataProvider x:Key="odpComboBoxRight"
                    ObjectType="{x:Type ODP:UgmProvider}" />
        <ObjectDataProvider x:Key="odpUgmUserGroupsLeft"
                    ObjectType="{x:Type ODP:UgmProvider}" />
        <ObjectDataProvider x:Key="odpUgmUserGroupsRight"
                    ObjectType="{x:Type ODP:UgmProvider}" />
        <ObjectDataProvider x:Key="odpOrganizationalUnits"
                    ObjectType="{x:Type ODP:UgmProvider}" />
        <Styles:UgmStyle x:Key="ugmStyleSelector"/>
        <Styles:UgmImgConverter x:Key="UgmImgConverter"/>
    </UserControl.Resources>
    <Grid Width="671.63" Height="517.298">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="261*" />
            <ColumnDefinition Width="155*" />
            <ColumnDefinition Width="256*" />
        </Grid.ColumnDefinitions>
        <!--Top Radio Buttons-->
        <RadioButton Name="rbUserMode" Height="16" Margin="0,21.671,96.686,0"  VerticalAlignment="Top"  GroupName="UGMMode" Click="rbMode_Checked" Grid.ColumnSpan="2" HorizontalAlignment="Right" Width="105.698">User Mode</RadioButton>
        <RadioButton Name="rbGroupMode" Height="16" Margin="35.007,21.671,10.002,0"  VerticalAlignment="Top" GroupName="UGMMode" Click="rbMode_Checked" Grid.Column="1">Group Mode</RadioButton>
        <RadioButton Name="rbTemplateMode" Height="16" Margin="125.025,21.671,186.704,0" VerticalAlignment="Top" GroupName="UGMMode" Click="rbMode_Checked" Grid.Column="1" Grid.ColumnSpan="2">Template Mode</RadioButton>
 
        <!--OU Comboboxes-->
 
        <ComboBox Name="cbRightOu" 
                  ItemsSource="{Binding}"
                  Margin="0,55.011,0,0"
                  DisplayMemberPath="Name"
                  Text="Please Select An OU"
                  VerticalAlignment="Top"
                  Grid.Column="2" 
                  SelectionChanged="LoadComboBox" Height="21.277" HorizontalAlignment="Left" Width="255.859" />
 
        <ComboBox Name="cbLeftOu"
                  SelectionChanged="LoadComboBox"
                  ItemsSource="{Binding}" DisplayMemberPath="Name"
                  Text="Please Select An OU"
                  Margin="0,55.011,0,0"  VerticalAlignment="Top"
                  />
 
 
        <!--Object Searched Comboboxes-->
        <ComboBox Name="cbListLeft" Height="23" Margin="0,87.769,0,0"
                  Focusable="true"  VerticalAlignment="Top" IsEditable="true"
                  IsReadOnly="False" IsTextSearchEnabled="True" DisplayMemberPath="Cn"
                  ItemsSource="{Binding}"
                  TextBoxBase.TextChanged="cbListLeft_TextChangedEventArgs"
                  DropDownClosed="cbListLeft_DropDownClosed" />
 
        <ComboBox Name="cbListRight" Height="23" Margin="0,87.769,0,0" 
                  VerticalAlignment="Top" Grid.Column="2"
                  IsEditable="True" DropDownClosed="cbListRight_DropDownClosed"
                  IsReadOnly="False" IsTextSearchEnabled="True"
                  DisplayMemberPath="Cn" ItemsSource="{Binding}"
                  SelectionChanged="cbList_SelectionChanged" />
 
 
        <!--Listviews-->
        <ListView Name="lvListLeft" Margin="0,129.948,0,53.344" 
                  DisplayMemberPath="Cn" ItemsSource="{Binding}" 
                  IsSynchronizedWithCurrentItem="True"
                  Styles:GridViewSort.AutoSort="True"
                  ItemContainerStyleSelector="{DynamicResource ugmStyleSelector}">
            <ListView.Resources>
                <DataTemplate x:Key="imgLvLeft">
                    <Image Width="12" Height="12" Margin="1" Source="{Binding Path=. , Converter={StaticResource UgmImgConverter}}" />
                </DataTemplate>
            </ListView.Resources>
 
            <ListView.View>
                <GridView >
                    <GridViewColumn  Width="30" CellTemplate="{StaticResource imgLvLeft}" />
                    <GridViewColumn  Header="Name"  Width="190"  DisplayMemberBinding="{Binding Cn}" Styles:GridViewSort.PropertyName="Cn"/>
                    <GridViewColumn>
                        <CheckBox Name="cbSelectAllLvLeft" Click="lvLeftSelAll_Clicked"></CheckBox>
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <CheckBox  IsChecked="False"  HorizontalAlignment="Center">
                                </CheckBox>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                </GridView>
            </ListView.View>
        </ListView>
 
        <ListView Name="lvListRight" Margin="0,129.948,0,53.344" 
                  DisplayMemberPath="Cn" ItemsSource="{Binding}" 
                  IsSynchronizedWithCurrentItem="True"
                  Styles:GridViewSort.AutoSort="True"
                  ItemContainerStyleSelector="{DynamicResource ugmStyleSelector}"
                  Grid.Column="2">
            <ListView.Resources>
                <DataTemplate x:Key="imgLvRight">
                    <Image Width="12" Height="12" Margin="1" Source="{Binding Path=. , Converter={StaticResource UgmImgConverter}}" />
                </DataTemplate>
            </ListView.Resources>
            <ListView.View>
                <GridView >
                    <GridViewColumn  Width="30" CellTemplate="{StaticResource imgLvRight}" />
                    <GridViewColumn   Header="Name"  Width="190"  DisplayMemberBinding="{Binding Cn}" Styles:GridViewSort.PropertyName="Cn"/>
                    <GridViewColumn>
                        <CheckBox Name="cbSelectAllLvRight" Click="lvRightSelAll_Clicked"></CheckBox>
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <CheckBox IsChecked="False"  HorizontalAlignment="Center">
                                </CheckBox>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                </GridView>
            </ListView.View>
        </ListView>
 
        <!--Actions Buttons-->
        <Button Name="btCompare" Grid.Column="1" Height="23" Margin="35.006,175.035,27.992,0"  VerticalAlignment="Top" Click="btCompare_Click">&lt;&lt; Compare &gt;&gt;</Button>
        <Button Name="btMoveToLeft" Grid.Column="1" Margin="35.007,0,27.992,175.035"  Click="btMoveToLeft_Click"  Height="22.199" VerticalAlignment="Bottom">&lt;&lt;</Button>
        <Button Name="btMoveToRight" Margin="35.007,0,27.992,223.75"  Grid.Column="1" Height="22.199" VerticalAlignment="Bottom" Click="btMoveToRight_Click">&gt;&gt;</Button>
        <Button Name="btHide" Height="23" Margin="35.006,223.378,27.992,0" VerticalAlignment="Top" Grid.Column="1" Click="btHide_Click" Tag="hide">Hide similar</Button>
        <Button Name="btRemSelect" Grid.Column="1" Height="23" Margin="35.006,0,27.993,53.344"  VerticalAlignment="Bottom" Click="btRemSelect_Click">Remove Selected</Button>
    </Grid>
 
</UserControl>