【发布时间】:2017-10-20 06:12:34
【问题描述】:
我正在尝试使按钮的效果与 Windows 10 Creators Update 应用程序中的效果相同。
按钮图片示例
.
我已经使用 SDK 插入了亚克力效果:
MainPage.xaml 代码:
<Page
x:Class="App1.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App1"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid x:Name="BaseGrid" Background="{ThemeResource SystemControlAcrylicElementBrush}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="1" HorizontalAlignment="Stretch" Background="White">
</Grid>
</Grid>
</Grid>
MainPage.xaml.cs 代码:
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
Windows.UI.Xaml.Media.AcrylicBrush myBrush = new Windows.UI.Xaml.Media.AcrylicBrush();
myBrush.BackgroundSource = Windows.UI.Xaml.Media.AcrylicBackgroundSource.HostBackdrop;
myBrush.TintColor = Color.FromArgb(255, 202, 24, 37);
myBrush.FallbackColor = Color.FromArgb(255, 202, 24, 37);
myBrush.TintOpacity = 0.6;
BaseGrid.Background = myBrush;
}
}
但是怎么可能有鼠标在通过时的“光”效果,点击时的波浪效果呢?
应该是独特的风格吗?
提前致谢!
【问题讨论】: