Reputation: 21
I need to be able to create dynamic controls at runtime - textblocks, buttons to be specific. I have tried this: dim b as button = new button b.content="test"
The code does not error but also does not produce a button either. Simple I know but for Wp8 it's quite difficult for me. Thanks
Upvotes: 2
Views: 690
Reputation: 28737
You still need to add the button to your page. Try this:
Xaml
<ContentControl x:Name="container">
</ContentControl>
Code
Dim b as New Button With { .Content = "test"}
container.Content = b
Upvotes: 2