Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
swdev:dotnet:wpf:resources [2010/12/29 12:07] smayr |
swdev:dotnet:wpf:resources [2011/07/01 09:30] (current) smayr |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | == Resources | + | = Resources = |
- | === Referencing Resources from an Assembly | + | == Embedding an Application Icon == |
+ | |||
+ | * Create App.rc: < | ||
+ | 101 ICON " | ||
+ | 102 ICON " | ||
+ | 103 ICON " | ||
+ | * Compile using Resource Compiler (Visual Studio Command Line):< | ||
+ | * Add '' | ||
+ | * Select icon for project: Project > Properties > Application > Resources: Icon and Manifest. | ||
+ | * Build. | ||
+ | |||
+ | Source: [[http:// | ||
+ | |||
+ | == Referencing Resources from an Assembly == | ||
In XAML, to reference an image in '' | In XAML, to reference an image in '' | ||
Line 16: | Line 29: | ||
NOTE: Make sure the image file is compiled as '' | NOTE: Make sure the image file is compiled as '' | ||
+ | |||
+ | == Localization using Resources == | ||
+ | * See: [[swdev: | ||
+ | |||
+ | == Resource Dictionary == | ||
+ | |||
+ | ==== ResourceDictionary in Application ==== | ||
+ | * Create a resource dictionary using XML. Eg: '' | ||
+ | < | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | < | ||
+ | <Color x: | ||
+ | <Color x: | ||
+ | <Color x: | ||
+ | . . . | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== ResourceDictionary Assembly ==== | ||
+ | * Create an assembly project in C#. | ||
+ | * Add references to: | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * Create a resource dictionary using XML: <code xml> | ||
+ | < | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | < | ||
+ | <Color x: | ||
+ | <Color x: | ||
+ | <Color x: | ||
+ | . . . | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ==== Merge ResourceDictionary at Application Scope ==== | ||
+ | |||
+ | '' | ||
+ | <code xml> | ||
+ | < | ||
+ | xmlns=" | ||
+ | xmlns: | ||
+ | x: | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | = References = | ||
+ | * [[http:// | ||
+ | * [[http:// |