How to load xaml from StreamingAssets?
Posted: 11 Oct 2021, 09:06
I want load xaml from StreamingAssets, so I try below code, which changed from Samples\Gallery\MainWindow.xaml.cs
But the Unity report error:
How to load xaml from StreamingAssets?
Best regards!
Code: Select all
//string sampleName = string.Format("Assets/NoesisGUI/Samples/Gallery/Samples/{0}.xaml", _selectedSample.Name);
//FrameworkElement sample = (FrameworkElement)Application.LoadComponent(new Uri(sampleName, UriKind.Relative));
string sampleName = UnityEngine.Application.streamingAssetsPath + "/Button.xaml";
FrameworkElement sample = (FrameworkElement)Application.LoadComponent(new Uri(sampleName, UriKind.Absolute));
[NOESIS/E] Xaml not found 'D:/temp/Tutorials-master/Samples/Gallery/Unity/Assets/StreamingAssets/Button.xaml'
How to load xaml from StreamingAssets?
Best regards!