So I'm working in VS12 on Windows 8, and hacking the ContosoCookbook code to make a different app. I'm trying to set up a "MainMenu.xaml" page and in I have:
<CollectionViewSource
x:Name="groupedItemsViewSource"
Source="{Binding Groups}"
IsSourceGrouped="true"
ItemsPath="TopItems"
d:Source="{Binding AllGroups, Source={d:DesignInstance Type=data:FlashCardDataSource, IsDesignTimeCreatable=True}}"/>
The error I'm getting is: The name "FlashCardDataSource" does not exist in the namespace "using:FlashCards.Data".
...but I don't understand how it doesn't. Where do I start looking? I'm new at XAML.
-Ken
If nothing else is possible, comment the lines which use the namespace, rebuild, and then build the full project again.
I also tried rebuilding the project, reopening Visual Studio. Nothing helped. I finally commented
xaml
, rebuilt the project, uncommentedxaml
and it finally worked! Strange issue.Did you try to rebuild your project? Maybe clean the project and rebuild again.
In my case, I clean all the property value relative to the binding I assign by code in all class, then all become normal.
I think if giving value to the property that using in bindings at the same time in some wrong position in class will cause problem, so remove all the assignment code relative to the property may help.
If cleaning and rebuilding does not help, try restarting Visual Studio. Worked for me.
None of the above worked for me, but simply adding another dummy class to the folder containing the class it claimed did not exist seemed to do the trick. Maybe it made VS have another look.
Generally this error is caused by one of the following: