ItemsControlによって生成されたテキストサイズ(ボタンコンテンツ)を簡単に同期する方法を探しています。ItemsSourceから生成されたアイテムを同期する
私は、次のXAMLコードを使用しています:私はすでに作品できるだけ大きなボタンのテキストを、作りたい
<ItemsControl ItemsSource="{Binding UseCases}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button Content="{Binding DisplayName}" Width="200" Height="200">
<Button.ContentTemplate>
<DataTemplate>
<Viewbox>
<ContentPresenter Content="{Binding}" />
</Viewbox>
</DataTemplate>
</Button.ContentTemplate>
</Button>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
を。
しかし、テキストの長さが異なるため、各ボタンのテキストサイズも異なり、奇妙に見えます。
Viewbox(またはその他の方法)に最小のテキストのサイズを取得し、すべてのボタンに使用するように簡単な方法がありますか?テキストのサイズを制限する