I want to create a basic user control with a style programmatically. In this style I want to add a Grid (no problem), but I can\'t add column definitions to thi
Grid
You just need to change the last part of your code. See below,
Original Code:
colDefinitions.AppendChild(c1); colDefinitions.AppendChild(c2); colDefinitions.AppendChild(c3); mainGrid.AppendChild(colDefinitions);
New Code:
mainGrid.AppendChild(c1); mainGrid.AppendChild(c2); mainGrid.AppendChild(c3);