TextBlock
の高さを親コントロールの高さにバインドするにはどうすればよいですか?
私はグリッドの中にあり、値をハードコーディングせずに&をグリッドセルの高さと幅にしTextBlock
たいです。TextBlock
Height
Width
乾杯
AWC
Viewboxは最も簡単な方法です:
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid>
<Viewbox>
<TextBlock Text="Hello World"/>
</Viewbox>
</Grid>
</Page>
お役に立てれば、
乾杯、アンバカ
これがあなたが探しているものです:
<Grid >
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock x:Name="SelectedUserName" Grid.Row="0" Grid.Column="0" ></TextBlock>
</Grid>
テキストボックスがグリッド内にある場合、グリッド セルの測定値から測定値を取得します。
試着しましたかTextBlock
:
VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
これはデフォルトです!