2

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.

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
Teodor
  • 497
  • 1
  • 6
  • 20

0 Answers0