C# – Windows 8 C#/XAML – Create a border around textblock text

cmicrosoft-metrowindows 8xaml

I'm creating an app for the Windows 8 app store and I'm pretty new to the XAML UI stuff. What I want to do is create a black border around the actual text in the textblock. Any help would be greatly appreciated.

Here is the textblock:

<TextBlock Grid.Row="0" x:Name="TopLabel" VerticalAlignment="Top" Text="Top Label" HorizontalAlignment="Center" FontFamily="Impact" FontSize="48"/>

Best Answer

Use Border control :

http://msdn.microsoft.com/en-us/library/windows/apps/xaml/windows.ui.xaml.controls.border.aspx

something like this :

<Border BorderBrush="Gray" BorderThickness="2" Grid.Row="0">
  <TextBlock x:Name="TopLabel" VerticalAlignment="Top" Text="Top Label" HorizontalAlignment="Center" FontFamily="Impact" FontSize="48"/>
</Border>
Related Topic