【发布时间】:2019-12-08 16:43:21
【问题描述】:
我尝试使用 RevealBackgroundBrush,但 Reveal Highlight 不起作用。
RevealBorderBrush 突出显示是有效的。
sdk 样式的 RevealBackgroundBrush 也可以工作(例如“ButtonRevealStyle”),但是如果我在应用程序资源中复制 ButtonRevealStyle 并为按钮 RevealBackgroundBrush 应用样式。
我重新安装了windows,并尝试在另一个uwp项目中使用刷子,但不起作用
我尝试使用 CSharp 代码:
private void RevealGrid_Loaded(object sender, RoutedEventArgs e)
{
var grid = sender as Grid;
grid.Background = new RevealBackgroundBrush() {
Color = Color.FromArgb(80, 0, 0, 0),
TargetTheme = ApplicationTheme.Light,
AlwaysUseFallback = false
}; // grid.background
}
我尝试使用 Xaml:
<Grid Height="48" VerticalAlignment="Top" Loaded="RevealGrid_Loaded" >
<Grid.Background>
<RevealBackgroundBrush AlwaysUseFallback="False" TargetTheme="Light" Color="#33818181" />
</Grid.Background>
</Grid>
详情:
Visual Studio 2019
SDK 10.0.18362.0
Windows 10 专业版 1903(18362.239 内部版本)
【问题讨论】:
标签: c# xaml uwp uwp-xaml uwp-c#