【发布时间】:2015-01-16 22:15:30
【问题描述】:
我的应用程序中有一个特定的配色方案,我不希望我的 LongListSelectors 跳转列表样式与我的配色方案完全匹配,我已经为 JumpList 创建了样式,就像这样。
<Style x:Name="LibraryJumpListStyle" TargetType="phone:LongListSelector">
<Setter Property="ItemTemplate">
<Setter.Value>
<DataTemplate>
<Border Background="#007fb3" Margin="6" toolkit:TiltEffect.IsTiltEnabled="True">
<TextBlock Text="{Binding Key}" FontFamily="{StaticResource PhoneFontFamilySemiBold}" FontSize="48" Margin="12,0,0,0" Foreground="White" VerticalAlignment="Bottom"/>
</Border>
</DataTemplate>
</Setter.Value>
</Setter>
<Setter Property="LayoutMode" Value="Grid"/>
<Setter Property="GridCellSize" Value="111,111"/>
<Setter Property="Margin" Value="12,6,0,0"/>
</Style>
但这使我所有的跳转列表项目,包括禁用(我没有任何项目的部分)都具有相同的颜色。我希望禁用的跳转列表项目具有不同的颜色。我知道为此我需要制作自己的 BackgroundConverter。但问题是我不知道从哪里开始或如何开始。我需要传递什么参数。我知道 valuse Converters 是如何工作的,并且自己编写了一些转换器。但在这里我不知道。我已经搜索并没有找到任何可以用作自定义 BackgroundConverter 基础的示例代码。有人可以帮忙吗?
【问题讨论】:
标签: c# xaml windows-phone-8 windows-phone ivalueconverter