TextBlock does not have a background property on its own. You must set the background to a grid or canvas or a border or rectangle to fill it.
<Grid Width="300" Height="100" Background="Blue"> <TextBlock Name="MyTextBlock" Text="Hello World!" Foreground="Black" /> </Grid>
Instead of a grid, you can make a rectangle or border.
source share