I'm trying to understand how XAML and code-behind talk to each other. I know that code-behind can access an element instantiated in XAML using the Name attribute eg:
Instantiate the button in XAML:
<SomeControlParent controlParent>
<Button Name=button1/>
<SomeControlParent controlParent>
Change properties of the button in code-behind:
button1.Content = "I created this button in XAML"
I was wondering if it was possible to do the opposite using XAML eg:
Instantiate the button in code-behind:
Button button1 = new Button();
controlParent.Child.Add(button1);
and then change the Content of the button using XAML.
Thanks! Soumaya