Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

New Post: Dynamic PropertyGrid

$
0
0
Hello,

I'm a new user to this toolkit. I love it so far.

I'm trying to use a property grid to show properties of my game entities. The problem is, each entity has it's own set of properties. I can't bind properties like you would with objects you know the data set for.

Is there anyway through C# code to setup a property grid so I can add properties dynamically?

In MFC I was able to do this through code by creating each property as a class and setting its properties and adding to the list of properties in my property grid. I can't seem to figure out if that's possible using this. I know WPF/Xaml is quite different, but I still believe I need to setup the types in xaml and setup the properties in C# somehow.

Something like this would be great...
DefaultTypeProperty p1 = new DefaultTypeProperty("MyKey1", 100);
DefaultTypeProperty p2 = new DefaultTypeProperty("MyKey2", "MyStringValue");
MyCustomTypeProperty p3 = new MyCustomTypeProperty("MyKey3", 200, min, max);

PropertyGrid pg = _myPropertyGrid // from xaml
pg.AddProperty(p1);
pg.AddProperty(p2);
pg.AddProperty(p3);

Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>