将 UI 添加到当前页面而不使用 XAML - Windows Phone Silverlight 8.1

adding UI to current page without using XAML - Windows Phone Silverlight 8.1

我需要向当前页面添加一些 UI 但我不能使用 XAML。

例如,我以这种方式创建一个文本块:

TextBlock textBlock = new TextBlock();
textBlock.Text = "text1";
Grid myGrid = new Grid();
myGrid.Children.Add(textBlock);

我需要做什么才能显示附加到我当前页面的 myGrid?

您指的是以编程方式构建 UI。这是一篇解释它的文章link

http://www.kirupa.com/blend_silverlight/programmatically_adding_elements_pg1.htm