if i have a textblock which i want to vary in width by the size of its contents, but i want the left of the textblock to maintain a certain spacing from the right of the container... how is this accomplished? I feel I'm overlooking something simple. Im specifically using WPF, if that matters.
The solution would be to place the TextBlock inside a StackPanel
like this:-
<StackPanel HorizontalAlighment="Right" Width="200">
<TextBlock Text="Some Text or binding" />
</StackPanel>
Where Width 200 represents the fixed distance you want the left border of the TextBlock
to be away from the right border of the element containing the StackPanel
.