Is it possible to set a resource's source in a ResourceDictionary by asset reference instead of a uri in Unity?
Posted: 16 Nov 2024, 12:01
When you create a BitmapImage in a ResourceDictionary, you have to use a string to set the path of the resource:
This can easily break if you move around the assets in your project. A better way would be to declare the BitmapImage in XAML, but set the resource through the editor like this:
However, it seems you can't see resources in this window; it's read-only. It would save a lot of time, and avoid potential issues in the future, if we could just set the resources in this window.
Code: Select all
<BitmapImage x:Key="Image.Icon.xxx" UriSource="xxx.png"/>
However, it seems you can't see resources in this window; it's read-only. It would save a lot of time, and avoid potential issues in the future, if we could just set the resources in this window.