I have some 50 image files which my app should be able to read as the ImageSource for a particular item in the app. There is a name property which corresponds to the filename of the .png file.
I have now spent 2 days trying all sorts of things trying the accomplish the above.
The latest is I create a folder under Images with the image files.
Now for testing I have the following code to see what is in the file system of Android.
var path = AppDomain.CurrentDomain.BaseDirectory;
List<string> dirFilesFromPath= Directory.EnumerateFiles(path).ToList();
List<string> dirDictoriesFromPath =Directory.EnumerateDirectories(path).ToList();
foreach(string dirFile in dirDictoriesFromPath)
{
List<string> dirDictories = Directory.EnumerateDirectories(dirFile).ToList();
List<string> dirFiles=Directory.EnumerateFiles(dirFile).ToList();
foreach(string drF in dirDictories )
{
List<string> dirDictories2 = Directory.EnumerateDirectories(drF).ToList();
List<string> dirFiles2 = Directory.EnumerateFiles(drF).ToList();
}
}
No matter what I have done the folder the files do not enumerate.
I have read about 100 posts about Maui and the file system but nothing in them helps.
The MS documentation is nowhere as to telling how to do what I want to do.
I want to be able to show an image from this app which has been put as (I really don't know and have tried everything Embedded Resource is last try) and have the file name as a property in the Item and should be able to read the image and present an ImageSource.
This is so easy in Xamarin and I keep reading how Maui is going to make things easier. Not accomplished up to now.