views:

255

answers:

1

I am using an ObjectDataProvider declared in the XAML as follows:

<UserControl.Resources>
    <ObjectDataProvider x:Key="odpTheList" 
                        ObjectType="{x:Type library:StaticClass}"
                        MethodName="GetListOfItems" />
</UserControl.Resources>

Basically it calls StaticClass.GetListOfItems() to get the data.

Ok, the problem is that this GetListOfItems throws an exception when i am in design time - it actually gets the data from the database; The problem is the designer crashes (understandably), but is there a way to use the ObjectDataProvider like i am trying to use and still have the designer support?..

At runtime, it works perfectly.

I also tried to set IsInitialLoadEnabled="False", but without success.

Thanx in advance.

+1  A: 

Have a read of this article by Cider program manager Karl Shifflett and this article by Silverlight MVP Laurent Bugnion to see how to use design time data.

Pete OHanlon