您不必固定任何控件的宽度或最大值。使用虚拟网格并绑定到其 ActualWidth。见代码https://github.com/omeraziz/NoTextOverflowWPF
<Window Title="NoTextOverflow"
x:Class="NoTextOverflow.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="Auto" Height="Auto"
ResizeMode="CanResize" SizeToContent="WidthAndHeight">
<!--
There is no fixed width in any of the UI elements including window, Label, TextBlock, TextBox etc.
Window's SizeToContent grows and shrinks with the contents.
-->
<Grid Margin="10" ShowGridLines="True">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Label VerticalAlignment="Center" Content="Type Here:" />
<TextBox x:Name="LongText"
Grid.Column="1" Grid.ColumnSpan="2"
Width="{Binding ElementName=WidthRestrictorGrid, Path=ActualWidth, Mode=OneWay}"
MinWidth="100"
Margin="5" HorizontalAlignment="Left" VerticalAlignment="Center"
Text="Type here a long message and resize this window" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" />
<!--
This grid is used to calculate width of middle two columns.
Remove this and its references to see the effect without this grid.
Since this is not parent of TextBox and TextBlock so it must have a Name to bind with its Actualwidth
-->
<Grid x:Name="WidthRestrictorGrid"
Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2"
Margin="10,1" HorizontalAlignment="Stretch" />
<TextBlock Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2"
Width="{Binding ElementName=WidthRestrictorGrid, Path=ActualWidth, Mode=OneWay}"
MinWidth="50"
Margin="5" HorizontalAlignment="Left" VerticalAlignment="Top"
Background="LightGray"
Text="{Binding ElementName=LongText, Path=Text}"
TextWrapping="Wrap" />
<Button Grid.Row="2" Grid.Column="3"
Margin="5" HorizontalAlignment="Right" VerticalAlignment="Bottom"
Content="Dummy" />
</Grid>