I need too add some control unit such as Grid
, Checkbox
,Textblock
and ... dynamically in my C# Code.
Assume XAML node like:
<CheckBox Content="CheckBox" Height="24" Click="CheckBoxes_Click"/>
Its C# equivalent is
AddNewCheckBox()
{
CheckBox NewCheckBox = new CheckBox ();
NewCheckBox.Content = "CheckBox1";
NewCheckBox.Height = 24;
NewCheckBox.Click += CheckBoxes_Click;
}
But there are many XAML assignment which it is hard to understand their C# equivalent.
As an example what should I write in my c# to create a CheckBox
like this?
<CheckBox Content="CheckBox" Margin="68,41,0,0" Background="Black"
Height="Auto" Click="CheckBoxes_Click"/>
Is there any way to understand how XAML parser maps phrases to C# code?