I have a Grid with a dynamic size. Inside I want to draw a diagonal TextBlock . I have already a diagonal Path where you can set LineGeometry for dynamic adjustment. But I can't find the pendant in the TextBlock. Do I miss something?
<Grid>
<TextBlock Text="Draft" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="180" FontWeight="Bold" Foreground="#FFA43A3A" RenderTransformOrigin="0.5,0.5"/>
<Path Grid.Row="2" Grid.Column="0" Stroke="Red" StrokeThickness="2" Stretch="Fill">
<Path.Data>
<LineGeometry StartPoint="1,0" EndPoint="0,1" />
</Path.Data>
</Path>
</Grid>
Preview
Target
This is waht I want to have without setting the absolute RotateTransform.
Comparism of both solutions
The red foreground is FrankM solution, the green one is from Henrik Hansen




You have to compute the angle of the TextBlock whenever the Grid's size changes, e.g. using a converter.
Here is an example:
The converter code:
Result: