I would like to create my ObjectDataProvider in my C# code behind rather than my XAML.
I was wondering how to change this XAML into equivalent C#. The XAML was generated by Microsoft Expression Blend 2, so the d: namespace can be ignored safely.
<ObjectDataProvider x:Key='FooSourceDS' ObjectType='{x:Type myNS:FooSource}' d:IsDataSource='True'/>
myNS is a namespace referencing my CLR object.
I’m getting hung up on specifying the ObjectType in C#:
ObjectDataProvider FooSourceDS = new ObjectDataProvider(); FooSourceDS.ObjectType = myNamespace.FooSource;
The Intellisence is correctly identifying FooSource as a ‘type’ which is what ObjectType is looking for isn’t it?
Is this what you need?