I have a feeling there is a simple solution but I'm just stuck.
In XAML I have a Grid with auto size, with several Rows, with TextBlock in each Row.
I need one of the TextBlocks to restrict it's Width so it doesn't stretch the Grid, while let the other ones to stretch and define Width of the Grid (= of the whole Control).
Or in other words so one TextBlock Width (MaxWidth) is set to Width of widest of the remaining TextBlocks.
Of course the restricted TextBlock has a text Wrap, the other ones don't.
When I just set the restricted TextBlock HorizontalAlignment="Left" (or anything else then Stretch) and TextWrapping="Wrap" the tblock still takes all space it can.
I can't simply bind the tblock's Width to some other element Width, because I need largest of several Widths.
The only solution I was able to think of..
I can derive from TextBlock, override OnArrange, somehow get sizes of its neighbor tblocks and set its size accordingly.
Or I can create a Converter and do basically similar as above with multi biding.
Thought it seems like I'm killing a mosquito with bulldozer and theres some simple solution I missed (?)
Edit: sample code
<Grid x:Name="rootGrid" HorizontalAlignment="Center" VerticalAlignment="Center" MinWidth="64" MinHeight="64" >
<Rectangle x:Name="bgRect" Fill="Gray" RadiusX="6" RadiusY="6" Margin="1" Grid.RowSpan="2" />
<Grid x:Name="contentGrid" Grid.Row="1" Margin="8,0,8,6" >
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<TextBlock x:Name="textName" Text="Gill Bates junior" FontWeight="Bold" FontSize="14" />
<TextBlock x:Name="textDesc" TextWrapping="Wrap" Grid.Row="1" HorizontalAlignment="Left"
Text="Test test test test Test test test test Test test test test Test test test test Test test test test Test test test test Test test test test " />
<TextBlock x:Name="textDates" Text="1995 - 2075" Grid.Row="2" />
</Grid>
</Grid>