1

I have included PRI resource in UWP application and im loading with ResourceLoader as like below code

ResourceLoader.GetForCurrentView("ResourceName");

How to detect whether i'm having the file in the application. While using the above code, app is taking more time to process this code if the file is not available. If the file is available then app is loaded immediatly

Thanks

VenkyDhana
  • 905
  • 5
  • 16
  • 1
    You could simply check if `File.Exists(YourResourcePath)`. Maybe you could also add an extension method to ResourceLoader (untested) `public static bool Exists(this ResourceLoader) { return File.Exists(YourResourcePath); }`. Could make your code more readable `if (ResourceLoader.Exists()) { // DoSomething }` – nilsK Aug 14 '18 at 09:40
  • When would the file not exist? – Peter Torr - MSFT Aug 14 '18 at 18:06

0 Answers0