locked
Create a new instance of a UserControl with C# RRS feed

  • Question

  • I've got a situation with a tutorial where the user would need to click the back/next buttons to walk through the steps.

    There will ultimately be several tutorials with a varying amount of steps, so I wanted to build something that could be re-used without having to code each individual piece.

    Coming from a Flash background, I could set a varialbe (say "totalSteps") and then just create an instance of a Movie Clip to match the number of total steps.

    Moving over to Blend & C#, it seems like using a UserControl like a MovieClip is the way to go, but I haven't found a way to dynamically create an instance of a UserControl from the code.

    Is this even possible?  Or should I be looking for a completely different option?

    Thanks

    Thursday, June 26, 2008 8:13 PM

Answers

  • You can create an instance of a UserControl in C# :

    RegistrationStepUserControl myControl = new RegistrationStepUserControl(); 
    tutorialControl.Children.Add(myControl); 


    http://www.yannalet.com
    Friday, June 27, 2008 12:27 PM