<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<LinearGradientBrush x:Key="ButtonNormalBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#C10099FF" Offset="0"/>
<GradientStop Color="#C16699CC" Offset="1"/>
<GradientStop Color="#C1006699" Offset="0.49"/>
</LinearGradientBrush>
<ResourceDictionary/>
Bây giờ tôi muốn lấy LinearGradientBrush từ ResourceDictonary và áp dụng nó tự động vào một nút làm màu nền trong wpf.Làm thế nào để lấy Brushes từ Resource Dictionary và áp dụng nó cho một phần tử dynamicallly trong wpf?
BtnGetBrushes.Background = Brushes.Green;
Tôi muốn áp dụng màu trên thay vì điều này (Brushes.Green). tôi nên làm gì?
trình cho tôi trên Windows Phone 8.0 Silverlight – aloisdg