[C#/WPF] ResourceDictionary 클래스 : 리소스에서 리소스 딕셔너리 구하기
■ ResourceDictionary 클래스를 사용해 리소스에서 리소스 딕셔너리를 구하는 방법을 보여준다. [TestLibrary 프로젝트] ▶ ResourceDictionary.xaml
1 2 3 4 5 6 7 8 9 10 11 12 |
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <RadialGradientBrush x:Key="RadialGradientBrushKey"> <RadialGradientBrush.GradientStops> <GradientStop Color="Pink" Offset="0" /> <GradientStop Color="Aqua" Offset="1" /> </RadialGradientBrush.GradientStops> </RadialGradientBrush> </ResourceDictionary> |
[TestProject 프로젝트] ▶ ResourceDictionary.xaml
1 2 3 4 5 6 7 8 9 10 11 12 |
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <LinearGradientBrush x:Key="LinearGradientBrushKey"> <LinearGradientBrush.GradientStops> <GradientStop Color="Pink" Offset="0" /> <GradientStop Color="Aqua" Offset="1" /> </LinearGradientBrush.GradientStops> </LinearGradientBrush> </ResourceDictionary> |
▶ BAMLReader.cs