WPF 新手,我有以下 XAML
<Window x:Class="Wpf.RossKiosk.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Topmost="True" WindowStartupLocation="CenterScreen" WindowState="Maximized" ResizeMode="NoResize" WindowStyle="None">
<DockPanel LastChildFill="True">
<StatusBar Name="StatusBarMain" Height="30" DockPanel.Dock="Bottom">
<StatusBarItem HorizontalContentAlignment="Left">
<TextBlock x:Name="TextBlockStatus" Margin="5,0,0,0" />
</StatusBarItem>
<StatusBarItem HorizontalContentAlignment="Stretch">
<ProgressBar x:Name="ProgressBarMain" IsIndeterminate="True" Height="15" />
</StatusBarItem>
<StatusBarItem HorizontalContentAlignment="Right">
<TextBlock x:Name="TextBlockInfo" Margin="5,0,0,0" TextAlignment="Right" />
</StatusBarItem>
</StatusBar>
<Grid Name="GridMain">
<!-- Dynamically Created buttons -->
</Grid>
</DockPanel>
我希望 ProgressBar 填充 StatusBar 的中心部分,但它只显示几个像素的宽度。有任何想法吗?