The "natural" way of referencing resources, such as images in a WPF project, is your second option. You can use a relative URI to point to an image, and WPF will lazily load it. You can reference resources in other assemblies using the package URI syntax .
Using Resources.resx will generate code properties that load resources when referenced. Resources can be strings, images, icons, or byte arrays. Using {x:Static} in XAML allows you to reference the static properties generated by the code generator, but often you will need a converter to convert the resource type to the type used by WPF.
There is some localization support using Resources.resx , and if you want to provide a multilingual application, you can save the translated strings in Resources.resx . However, WPF localization , as described by Microsoft, is not based on Resources.resx .
For images, the second option is much simpler. For strings, the first option is probably simpler, but instead, you can stay in XAML and create a ResourceDictionary .
Martin liversage
source share