我正在尝试为我创建的按钮控件模板复制现今如此时髦的"reflex"效果。
基本思路是创建一个带有从白色到透明的渐变填充的矩形,接着用一个矩形几何图形剪切这个半透明矩形的一部分。
问题是我不知道如何定义相对矩形几何。我通过定义一个大值(1000)来解决了宽度问题,但高度是个问题。例如,它适用于高度为200的按钮,但对于较小的按钮则无法起作用。
有什么建议吗?
<Rectangle RadiusX="5" RadiusY="5" StrokeThickness="1" Stroke="Transparent">
<Rectangle.Fill>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,0.55">
<GradientStop Color="#66ffffff" Offset="0.0" />
<GradientStop Color="Transparent" Offset="1.0" />
</LinearGradientBrush>
</Rectangle.Fill>
<Rectangle.Clip>
<RectangleGeometry Rect="0,0,1000,60" />
</Rectangle.Clip>
</Rectangle>
http://schemas.microsoft.com/winfx/2006/xaml/presentation
。 - Abe Heidebrechtxmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
和xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
。我的解决方案中从未出现过“2007”。这是一个Windows Phone 8应用程序。 - Cœur