在我的應用程序,我想創建一個具有GradientStop
s的系統顏色褪色線,我試圖做這樣的:安裝系統顏色以一個LinearGradientBrush
<UserControl.Resources>
<Style x:Key="Divider" TargetType="Rectangle">
<Setter Property="Height" Value="2" />
<Setter Property="Fill">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="{StaticResource PhoneChromeBrush}" Offset="0.0" />
<GradientStop Color="{StaticResource PhoneInverseBackgroundBrush}" Offset="1.0" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
但是,當我嘗試編譯項目我得到以下錯誤:
A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in System.Windows.ni.dll
An exception of type 'System.Windows.Markup.XamlParseException' occurred in System.Windows.ni.dll but was not handled in user code
我應該怎麼做才能解決這個問題?
'PhoneChromeBrush'和'PhoneInverseBackgroundBrush'預先定義在WP8的應用程序,他們不是漸變,但純色畫筆。 – Anton