What is the current directory?
I'm intergate noesis to o3de, create a gem named noesisgem, and in one file named NoesisManager.cpp called this code
should I put the Test.xaml the same diretory of NoesisManager.cpp ?
Here is the Test.xaml, I just use this line to load, but it return null
Code: Select all
Noesis::GUI::SetXamlProvider(MakePtr<LocalXamlProvider>("."));
Noesis::GUI::SetFontProvider(MakePtr<LocalFontProvider>("."));
Noesis::GUI::SetTextureProvider(MakePtr<LocalTextureProvider>("."));
Here is the Test.xaml, I just use this line to load, but it return null
Code: Select all
Noesis::Ptr<Noesis::Grid> xaml = Noesis::GUI::LoadXaml<Noesis::Grid>("Test.xaml");
-
sfernandez
Site Admin
- Posts: 2983
- Joined:
Re: What is the current directory?
The current directory depends on how you launch your application and what your application code does.
It could be the executable directory or the project folder if you run it from Visual Studio.
If you place the Test.xaml in your project folder and launch the application from Visual Studio it should be able to load the xaml with that code.
It could be the executable directory or the project folder if you run it from Visual Studio.
If you place the Test.xaml in your project folder and launch the application from Visual Studio it should be able to load the xaml with that code.
Re: What is the current directory?
LocalXamlProvider loads content from the current working directory but nothing stops you from creating your own provider implementation to load XAMLs from wherever you need. Our examples use EmbeddedXamlProvider to load from the executable itself.
Who is online
Users browsing this forum: Google [Bot] and 90 guests