我的下面代码抛出空引用异常
// Create a string
String sb = "<TextBlock xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' Text=\"Name (as per IC)\" Margin=\"1,0,0,80\" Grid.RowSpan=\"2\"/>";
// Create a textblock using a XamlReader
TextBlock myTextBlock = (TextBlock)XamlReader.Load(sb.ToString());
// Add created button to previously created container.
splMain.Children.Add(myTextBlock);