Loading a Xaml (View) and DataContext (ViewModel) at runtime using C# Managed SDK
Posted: 22 Nov 2023, 01:56
I was wondering if it is possible to load a specific xaml (View) file with a specific DataContext (ViewModel) class from code using the C# Managed SDK?
If yes, could you provide a quick code example?
I know this is possible using the Unity SDK, you gave a quick code example in this post:
viewtopic.php?t=3115#p16263
However the NoesisView and NoesisXaml classes are specific to the Unity SDK so I am not sure how to do the exact same thing in that post using just the C# Managed SDK.
I don't want to use DataTemplates because that links a specific ViewModel with a specific View. I want to set what XAML file and DataContext classes to use manually (exactly like the Unity SDK).
If yes, could you provide a quick code example?
I know this is possible using the Unity SDK, you gave a quick code example in this post:
viewtopic.php?t=3115#p16263
However the NoesisView and NoesisXaml classes are specific to the Unity SDK so I am not sure how to do the exact same thing in that post using just the C# Managed SDK.
I don't want to use DataTemplates because that links a specific ViewModel with a specific View. I want to set what XAML file and DataContext classes to use manually (exactly like the Unity SDK).