load another XAML fragment or XAML file?
How do you load another XAML or a XAML fragment on-top of an existing XAML file?
1) I have an existing UI.
i want to popup a dialog box. How do I do that?
2) I have an existing UI.
I want to switch to render another XAML file. How do i do that?
1) I have an existing UI.
i want to popup a dialog box. How do I do that?
2) I have an existing UI.
I want to switch to render another XAML file. How do i do that?
Re: load another XAML fragment or XAML file?
1. Either you have it already defined in XAML and just switch the visibility or you load it at runtime in code: NoesisGUISystem.LoadXaml()
2. There are again several possibilities. The first two that come to my mind are:
- You could load them all and just switch the visibility depending on what you want to see.
- You could have a ContentPresenter where you set the content to what you want to see.
PS: You should use the search function of this forum as various questions were already asked and you wouldn't have to wait for someone to answer.
2. There are again several possibilities. The first two that come to my mind are:
- You could load them all and just switch the visibility depending on what you want to see.
- You could have a ContentPresenter where you set the content to what you want to see.
PS: You should use the search function of this forum as various questions were already asked and you wouldn't have to wait for someone to answer.
-
sfernandez
Site Admin
- Posts: 3184
- Joined:
Re: load another XAML fragment or XAML file?
Thanks for helping here Scherub
As he explained it all depends on what you want to accomplish, but the basic bits are:
As he explained it all depends on what you want to accomplish, but the basic bits are:
- NoesisGUISystem.LoadXaml() can be used to load a xaml file from your Unity project.
- If you created your own UserControl you can even call: new MyUserControl(), to load its associated xaml and add it to current UI.
- You usually have a MainWindow.xaml attached to the camera that covers the entire screen. That xaml is used as root container to host and transition between all the UI panels you load and want to show in your game. You can take a look at our ControlGallery sample to learn how to make a cool transition between 2 xamls.
Who is online
Users browsing this forum: Ahrefs [Bot] and 6 guests