1

I have a child window created in silverlight. I need to load a user control within the child window(for a content change in the same child window) on a button click. How can i acheive this?

Say for Example: If i have a child window with a Header -> Content -> Button. I just need to change the content part and the button part on click of the button. I need to change the buttons also since navigation is not possible using the same button click events.

Is it possible to acheive this in Silverlight 4.0 or 5.0?

1 Answers1

0

Here is one way to do it. Create a canvas to hold the content and on button click, add the user control and add it as a child to the canvas. If you want to change the button, rather than changing the button, in the same button click the button content to a different text.

private void Button_Click_1(object sender, RoutedEventArgs e)

{
SilverlightControl1 control1 = new SilverlightControl1();
top.Children.Add(control1);
}

Hope this helps.

Nair
  • 7,438
  • 10
  • 41
  • 69