【发布时间】:2020-08-28 14:15:44
【问题描述】:
我的页面上有一个 Flyout 控件,我想更改它的背景颜色。我怎样才能做到这一点?
<Button x:Name="btn" Background="Transparent">
<Image HorizontalAlignment="Center" />
<Button.Flyout >
<Flyout Placement="Left" >
<ListView ItemsSource="{x:Bind DDLItemsSource, Mode=OneWay}" Background="Green" VerticalAlignment="Stretch"
SelectionChanged="StudentsList_SelectionChanged" x:Name="StudentsList" SelectionMode="Extended" HorizontalAlignment="Stretch" >
<Style TargetType="ListViewItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
</Style>
</ListView>
</Flyout>
</Button.Flyout>
</Button>
【问题讨论】:
-
你需要一个自定义的 MenuFlyoutPresenterStyle;请参阅stackoverflow.com/questions/57519359/… 处的示例