[C#] ObservableCollection, ''c" est un préfixe non déclaré
Salut à tous.
je continu de débuter en C# et je galère....
je fais un test basé sur les "observablescollection" trouvé sur le MSDN (qui, en général, donne de bons exemples) mais la, y a un hic!!
dans le MSDN j'ai ceci:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| <Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:c="clr-namespace:SDKSample"
x:Class="SDKSample.Window1"
Width="400"
Height="280"
Title="MultiBinding Sample">
<Window.Resources>
<c:NameList x:Key="NameListData"/>
...
</Window.Resources> |
que j'ai transformé de la façon suivante:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| <Window
x:Class="test_observablecollection.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Window.Resources>
<c:NameList x:key="NomListeFournisseur"/>
</Window.Resources>
<Grid>
<ListView Height="271" HorizontalAlignment="Left" Margin="271,18,0,0" Name="Liste" VerticalAlignment="Top" Width="116" ItemsSource="{Binding Source={StaticResource NomListeFournisseur}}" ItemTemplate="{StaticResource Nameitemtemplate}" IsSynchronizedWithCurrentItem="True" />
<TextBox Height="16" HorizontalAlignment="Left" Margin="9,26,0,0" Name="Nom" VerticalAlignment="Top" Width="116" />
<TextBox Height="16" HorizontalAlignment="Left" Margin="9,48,0,0" Name="prenom" VerticalAlignment="Top" Width="116" />
<Button Content="Button" Height="29" HorizontalAlignment="Left" Margin="168,30,0,0" Name="button1" VerticalAlignment="Top" Width="55" />
</Grid>
</Window> |
et voici l'erreur n° 1 annoncée:
Citation:
Erreur 1 MC3000*: XML ''c' est un préfixe non déclaré. Ligne 7, position 10.' non valide. C:\Users\Johann\Documents\Visual Studio 2010\Projects\test observable collection\Sol_test_observablecollection\test_observablecollection\MainWindow.xaml 7 10 test_observablecollection
je ne comprend pas...
merci à tous.