スタックパネル内に 5 つの境界線があり、各境界線の幅はウィンドウ幅/5 です。ウィンドウを最大化すると、各境界線の幅はウィンドウ幅/5 に従ってサイズ変更されます。
コンバーターを試してみましたが、コンバーターがウィンドウのサイズが変更されたことを認識する方法として機能しません。
<Window x:Class="ItemPanelTemplateTest.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<StackPanel Orientation="Horizontal">
<Border Height="20" Background="Red" Width="105" />
<Border Height="20" Background="Green" Width="105" />
<Border Height="20" Background="Yellow" Width="105" />
<Border Height="20" Background="Blue" Width="105" />
<Border Height="20" Background="Orange" Width="105" />
</StackPanel>
</Window>
私はMVVMを使用しているので、コードビハインドには何も書きたくありません。