ObjectDataProvider giving unrecognised type error for ObjectType

When i put the following code:

<ObjectDataProvider  x:Key=”MyKeysDataProvider” ObjectType=”{x:Type local:MyKeysDataProvider}”/>

It gave a design time error that MyKeyDataProvider is not defined. I wasted a lot of time to solve this only to find that one single line in the main window attributes could solve the problem. Show in red below:

<Window x:Class=”MyFirstWPFApp.Grid”
Title=”Grid” Height=”393″ Width=”994″  WindowState=”Maximized”>

Funny enough, it was still giving error till the red line highlighted below was cut and pasted one line below(simple carriage return) and it worked

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s