tags:

views:

91

answers:

0

HI,

I have a XAML file where i have defined the UI elements. In my code behind for the window, i add some uielements into one of the controls i have in the xaml file, and when I run it, it does not show up my control that i have added using the c# code.

For checking purposes, i tried to remove all controls i had setup via the XAML, in my C# code - to see if the code has any effect at all.

When i run the code, the c# code bits goes through removing the controls from the control i have setup in the xaml, but the window still continues to display the controls i had setup in the XAML.

What is going on that i don't understand? Is there no way to add to controls collection of controls i have setup using XAML, from C# code? I don't even seem to be able to simply remove the controls from my code, that i had setup in XAML.

Is there any API call i am missing that i should call when i do something to the controls setup using XAML, like Refresh() etc that we do in WinForms?

I have tried doing UpdateLayout on the control (on which i am tryuing to add new controls, remove from etc.), but does not seem to help.

Any ideas?