gpt4 book ai didi

xaml - 在 UWP 中获取强调色的变化

转载 作者:行者123 更新时间:2023-12-04 19:44:25 25 4
gpt4 key购买 nike

我正在尝试使用主题资源 SystemAccentColorLight1 SystemAccentColorLight2 获得更轻的强调色变化......

我收到此异常:
找不到与此错误代码相关的文本。

找不到名称/键为 SystemAccentColorLight1 的资源 [行:15 位置:19]

<Grid Background="{ThemeResource ResourceKey= SystemAccentColorLight1}"  HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Padding="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60" />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Image Source="{Binding Path=Owner.ProfileImage}" Width="50" Height="50" Grid.Column="0" Grid.Row="0" Grid.RowSpan="2"></Image>
<TextBlock Text="{Binding Title}" FontSize="12" TextWrapping="WrapWholeWords" FontWeight="SemiBold" Grid.Column="1" Grid.ColumnSpan="2"/>
<TextBlock Text="{Binding Path=Owner.DisplayName}" VerticalAlignment="Bottom" HorizontalAlignment="Left" FontSize="9" Grid.Column="1" Grid.Row="1" />
</Grid>

https://msdn.microsoft.com/windows/uwp/style/color?f=255&MSPPError=-2147217396

In XAML, the primary accent color is exposed as a theme resource named SystemAccentColor. The shades are available as SystemAccentColorLight3, SystemAccentColorLight2, SystemAccentColorLight1, SystemAccentColorDark1, SystemAccentColorDark2, and SystemAccentColorDark3. Also available programmatically via UISettings.GetColorValue and the UIColorType enum.

最佳答案

正如@Mark W 所说, SystemAccentColorLight1 来自较新的 SDK。

我用 测试它Window 10 Enterprise Insider 预览版 版本和操作系统构建为 14316.1000 .它可以获得更轻的强调色变化。

欢迎您加入Windows Insider Program您可以下载preview SDK使用此功能。

评论:

一些信息与预发布产品有关,这些信息在商业发布之前可能会进行实质性修改。 Microsoft 对此处提供的信息不作任何明示或暗示的保证。

关于xaml - 在 UWP 中获取强调色的变化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37051106/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com