dengfan
Topic Author
Posts: 22
Joined: 19 Nov 2023, 10:32

native sdk with glfw, What is the best way to show or close UI parts?

28 Nov 2023, 12:32

I looked at a few official Samples and found that most of them write all UI components in MainWindow.xaml, and then use the Visibility property to control the display and hiding.

I'd like to ask if there's a way to load UI parts on demand, such as creating which UI part needs to be displayed, and destroying it when it's closed.

Or which plan do you recommend?
 
User avatar
jsantos
Site Admin
Posts: 4823
Joined: 20 Jan 2012, 17:18
Contact:

Re: native sdk with glfw, What is the best way to show or close UI parts?

30 Nov 2023, 13:29

You can manually load XAMLs and add them dynamically to your root container. This way you can split a XAML into several pieces.

This Layered sample also exposes a more advanced way for UI organization using DataTemplate and UserControl.
 
dengfan
Topic Author
Posts: 22
Joined: 19 Nov 2023, 10:32

Re: native sdk with glfw, What is the best way to show or close UI parts?

30 Nov 2023, 13:39

The example is GREAT, thank you very much!

Who is online

Users browsing this forum: Bing [Bot] and 6 guests