我想动态更改我的 longlistselector 的跳转列表的颜色。我在 xaml 中定义了 JumpListBackgroundCONverter,如下所示
<phone:PhoneApplicationPage.Resources>
<phone:JumpListItemBackgroundConverter x:Name="BackgroundConvert" x:Key="BackgroundConverter" Enabled="#FFA20025"/>
在 C# 中,组件初始化后 BackgroundConvert 返回 null
public MainPage()
{
InitializeComponent();
this.BackgroundConvert.Enabled = new SolidColorBrush(ThemeGradient.Color);
我将启用的值更改为新画笔,并计划在整个代码中更改它。由于某种原因,它返回 null 并崩溃。
在 InitializeComponent 我想 FindName 返回 null 但我不知道为什么
this.BackgroundConvert = ((Microsoft.Phone.Controls.JumpListItemBackgroundConverter)(this.FindName("BackgroundConvert")));
顺便说一句,这是适用于 windows phone 8 的!