TextBlock myTextBlock = new TextBlock() { Text = "Text Block",Width = 140,Height = 40,FontSize = 20 };
TextBlock myTextBlock = new TextBlock() { Text = "Text Block",Width = Double.NaN,Height = Double.NaN,FontSize = 20 };
另见MSDN