我想AutoSuggestBox
在CommandBar
. 但是,以下代码不会进行AutoSuggestBox
拉伸。我尝试设置HorizontalContentAlignment="Stretch"
and HorizontalAlignment="Stretch"
,但没有影响。我错过了什么?
<CommandBar Grid.Row="0" HorizontalContentAlignment="Stretch">
<CommandBar.Content>
<AutoSuggestBox HorizontalAlignment="Stretch" Margin="8 8 8 4" PlaceholderText="Search podcasts" QueryIcon="Find">
<Interactivity:Interaction.Behaviors>
<Core:EventTriggerBehavior EventName="QuerySubmitted">
<Core:InvokeCommandAction
Command="{Binding SearchCommand}"
InputConverter="{StaticResource QueryArgsConverter}" />
</Core:EventTriggerBehavior>
</Interactivity:Interaction.Behaviors>
</AutoSuggestBox>
</CommandBar.Content>
</CommandBar>