Hello.
I am looking for good example and code for building XAML on runtime (and not touch the XAML file at design time).
A sample like on
http://blogs.msdn.com/b/scmorris/archive/2008/04/14/defining-silverlight-datagrid-columns-at-runtime.aspx[
^]
I need code so I can download and learn from (not something too complicated).
... I have tried so lot to build a simple sample, and got into exception :
CellTemp.Append("<DataTemplate ");
CellTemp.Append("xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' >");
CellTemp.Append("<TextBox Text="{Binding MyProperty, Mode=TwoWay}" KeyDown="TextboxEdit_KeyDown></TextBox> ");
CellTemp.Append("</DataTemplate>");
and I succeed doing :
gt = new DataGridTemplateColumn();
The exception :
An unhandled exception ...
Code : 4004
Category : ManagedRuntimeError
Message : System.TypeInitializationException: The type initalizer for 'Missing template. Cannot Initialize.
Please, help.
Thanks :)