Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
KittyHawk
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01474434
Message ID:
01476402
Views:
141
Paul,

If you implement a custom dynamic object you can do that (I think). I think even then you have to do a bit of work to make sure you publish the appropriate metadata when Reflection requests it. If you use ExpandoObject then no - there's no type information at all and no Reflection. So this:
            dynamic expando = new ExpandoObject();
            expando.Name = "Rick Strahl";
            expando.Company = "West Wind Technologies";

            // fails
            string name = ReflectionUtils.GetProperty(expando, "Name") as string;
fails because the property definition doesn't exist on dynamic. This makes binding a bit difficult (for example with my custom Web data binder)


>>>Thanks for the clarification. Yes, there is no intellisense (I've been playing with it in VS2010).
>>>
>>>That's a good point about ExpandoObject: assuming it is, that means the columns can be bound to WPF controls.
>>
>>
>>Actually I'm not sure if ExpandoObject properties can bind or not. Underneath the covers the properties are stored in a dictionary and I don't think Reflection actually works against Expando objects so I kind of doubt it works but I'm not sure... interesting to try out (don't have time this second tho :-))
>>
>
>Wouldn't you just bind against the properties themselves (not the columns of the underlyng dictionary)? From what Markus has done this sounds like it works just fine:
>
>http://www.markusegger.com/Blog/Development.aspx?messageid=3dfccfc5-1a30-4af1-a924-da22f3ff6057
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Reply
Map
View

Click here to load this message in the networking platform