10
我試圖在我正在創建的按鈕的控制模板上覆制時下如此時尚的「反射」效果。相對尺寸的矩形幾何......如何?
基本的想法是創建一個帶有從白色到透明的漸變填充的矩形,然後用矩形幾何圖形裁剪一些半透明矩形。
問題是我不知道如何定義相對矩形幾何。我通過定義一個大值(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>
它告訴我:「這個名字 「MultiBinding」不存在於名稱空間「http://schemas.microsoft.com/client/2007」。「 – 2013-03-31 12:31:19
我不知道xaml命名空間的用途是什麼,但你的應該是'http:// schemas.microsoft.com/winfx/2006/xaml/presentation'。 – 2013-03-31 15:06:19
我有:'xmlns =「http://schemas.microsoft.com/winfx/2006/xaml/presentation」' 和'xmlns:x =「http://schemas.microsoft.com/winfx/2006/xaml 「'。我的解決方案中沒有一次是「2007」。這是一個Windows Phone 8應用程序。 – 2013-03-31 20:07:33