Search code examples
windows-phone-7dynamictextblock

Add Elements dynamically to The XAML page in Windows Phone 7


I'm new to WP7 and I want to know if there is any way to add items like a TextBlock to a page dynamically using the .cs part??


Solution

  • Try this

    var textBlock = new TextBlock();
    // set some properties
    YourMainContainer.Children.Add(textBlock); //
    

    If you need more details just comment this