How to use AssetLoader.GetAssets() ? #15744
Unanswered
LaurentInSeattle
asked this question in
Q&A
Replies: 1 comment 5 replies
-
Try including the assembly name in the Uri and see what happens. I don't know how flexible the underlying implementation is, but you can certainly query for all assets in an assembly and filter later. I use this approach: https://github.com/stevemonaco/AvaloniaDemos/blob/master/Debugging/DebugPlus/DebugPlus.cs#L38 |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
I am building a localization model based on Tim's sample code.
I am trying to list all resource files present in a subfolder of the regular "Assets" folder to detect language files.
I was thinking that GetAssets would do just that but it always returns an empty enumerable.
Accessing the language files does work with:
string uriString = string.Format("avares:{0}/{1}/{2}.axaml", AssetsFolder, LanguagesFolder, targetLanguage);
var uri = new Uri(uriString);
var newLanguage = new ResourceInclude(uri) { Source = uri };
So I think the URI's are correct.
Full Source: https://github.com/LaurentInSeattle/TextoCopier/blob/main/TextoCopier/TextoCopier/Models/LocalizerModel.cs
On Windows 10, Visual Studio 2022, .Net 8 with Ava 11.0.10
Beta Was this translation helpful? Give feedback.
All reactions