I'm working on a Modern UI app and i'm currently trying to access my app's resources file (Resources.resw) from a backgroundtask. Both are in different projects in the same solution. I tried that way :
ResourceLoader resources = new ResourceLoader("MyApp/Resources");
But i've got an arror as it can't get to the resources map.
Is there a specific way to do that ?
In case anyone comes across this.
In UWP, it seems that you don't have to do anything special to make this work. If the .resw
files are included in the main UWP project, you can use the resource loader to retrieve them even from the background task assembly. For a resource string called LiveNotifications-ItemComplete, it would be the following:
var resource = new ResourceLoader().GetString("LiveNotifications-ItemCompleted");
Hope this helps!
Try to use just the name of the resource file. If the name is MyResources.resw, then use:
ResourceLoader resources = new ResourceLoader("MyResources");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With