Windows phone 8.1 Windows Phone 8.1:如何更改按钮弹出框中ListPickerFlyout的背景色和前景色
我有一个Windows Phone 8.1应用程序 我有一个带列表选择器的按钮Windows phone 8.1 Windows Phone 8.1:如何更改按钮弹出框中ListPickerFlyout的背景色和前景色,windows-phone-8.1,winrt-xaml,Windows Phone 8.1,Winrt Xaml,我有一个Windows Phone 8.1应用程序 我有一个带列表选择器的按钮 <Button x:Name="myButton" Foreground="Red" Background="Green"> <Button.Flyout> <ListPickerFlyout x:Name="myListPicker"> </ListPickerFlyout> </Button.Fl
<Button x:Name="myButton"
Foreground="Red" Background="Green">
<Button.Flyout>
<ListPickerFlyout x:Name="myListPicker">
</ListPickerFlyout>
</Button.Flyout>
</Button>
我需要更改ListPickerFlyout的背景色和前景色
<Button x:Name="myButton"
Foreground="Red" Background="Green">
<Button.Flyout>
<ListPickerFlyout x:Name="myListPicker">
</ListPickerFlyout>
</Button.Flyout>
</Button>
如果有人能帮助我,我将非常高兴。
提前谢谢。要改变背景,我从这里得到了答案
要更改前景,请执行以下操作:
下面的示例显示将前景设置为红色
<ListPickerFlyout ItemsSource="{Binding Items}"
SelectedValue="{Binding SelectedItem, Mode=TwoWay}">
<ListPickerFlyout.ItemTemplate>
<DataTemplate>
<TextBlock Foreground="Red"
Text="{Binding name}" />
</DataTemplate>
</ListPickerFlyout.ItemTemplate>
</ListPickerFlyout>
如果您想让它适应带有黑白前景的明暗主题,请使用类似于ThemeBrush的AppBarToggleButtonCheckedByorderThemebrush