【发布时间】:2018-07-02 08:25:09
【问题描述】:
在下面的标记中,我在 Scrollviewer 中有标签。理想情况下,我不希望 DockPanel 在那里,但它在那里进行测试(它没有解决问题)。
我希望 Scrollviewer 填充剩余空间(将“发送电子邮件”按钮放在列底部)。
我做什么似乎都不重要,我做不到这该死的事情......
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0">
<ComboBox ItemsSource="{Binding Campaigns}"
DisplayMemberPath="Name"
HorizontalAlignment="Stretch" VerticalAlignment="Top"
IsEditable="True" IsReadOnly="True"
SelectedItem="{Binding SelectedCampaign}"
Text="Select a Campaign"/>
<ComboBox ItemsSource="{Binding Emails}"
DisplayMemberPath="Subject"
HorizontalAlignment="Stretch" VerticalAlignment="Top"
IsEditable="True" IsReadOnly="True"
SelectedItem="{Binding SelectedEmail}"
Text="Select an Email"/>
<ComboBox ItemsSource="{Binding Groups}"
DisplayMemberPath="Name"
HorizontalAlignment="Stretch" VerticalAlignment="Top"
IsEditable="True" IsReadOnly="True"
SelectedItem="{Binding SelectedGroup}"
Text="Select a Contact Group"/>
<Button Command="{Binding LoadContactsCommand}"
CommandParameter="{Binding SelectedGroup}"
HorizontalAlignment="Stretch" VerticalAlignment="Top"
ToolTip="Refresh the current list of contacts." Content="Load Contacts"/>
<DockPanel VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ScrollViewer DockPanel.Dock="Bottom" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<Label Content="{Binding SendStatus, UpdateSourceTrigger=PropertyChanged}"
Height="auto" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
</ScrollViewer>
</DockPanel>
<Button Command="{Binding SendEmailsCommand}" Content="Send Emails"
VerticalAlignment="Bottom" HorizontalAlignment="Stretch"/>
</StackPanel>
</Grid>
【问题讨论】:
标签: wpf wpf-controls