I'm fairly new to C# WPF, and am not sure if the property grid is usable for this, there are aspects to C# that I'm still learning to wrap my head around.
I have a list of dataclass where the data class has the following properties, Parent, Name, Value, ValueType. What I'd like to do is somehow convert things so that the property grid displays the data in the manner where Parent is Category, Name is the property name, and Value is the property value with the editor determined by the ValueType.
Basically, I have an xml file that contains config information blocks, and I need to display each block on its own. There are several different types of blocks, and their contents are somewhat fluid, so a specific class for each block really doesn't work well.
I'm hoping that there is a way to override the automatic property generation on the lists, but if I have to populate and depopulate manually I can also do that.
General Class structure is roughly:
public class ConfigBlock
{
public List<DataUnit> Data { get; set; } // This is the data that needs to be converted for display.
}
public class DataUnit
{
public string Parent { get;set; }
public string Name {get;set;}
public string Value {get;set}
public DataTypes ValueType {get;set}
}
public enum DataTypes
{
StringData,
IntData,
FloatData,
List1, // Value limited to items in a seperate list of strings. (drop-down menu)
List2, // Value limited to items in seperate list of strings (drop-down menu)
List3 // Value limited to items in seperate list of strings (drop-down menu)
}
Is there a way to do this? If you can point me in the right direction I'd be thankful. I've been trying to search for examples but am getting a bit confused and have gone down several wrong paths.
↧