samrrr
Topic Author
Posts: 12
Joined: 05 Jul 2022, 12:39

How add page in page?

16 Sep 2022, 16:16

I have 2 pages.
Page1 with some grid.
Page2 with some elements.

Gui in cpp.
How add page2 to page1 and get pointers of elements in internal page2?
 
User avatar
sfernandez
Site Admin
Posts: 2983
Joined: 22 Dec 2011, 19:20

Re: How add page in page?

19 Sep 2022, 13:36

Hi,

A Grid is a panel which exposes a list of children elements. You can just add a new loaded page to the grid by doing:
Noesis::Ptr<Noesis::Page> page2 = Noesis::GUI::LoadXaml<Noesis::Page>("Page2.xaml");
grid->GetChildren()->Add(page2);
And to access the children of the page you can iterate them using VisualTreeHelper, or if they are named elements (x:Name), then you can just look for them in the loaded page by doing:
Noesis::Button someButton = page2->FindName<Noesis::Button>("someButton");
Is that what you are looking for?
 
samrrr
Topic Author
Posts: 12
Joined: 05 Jul 2022, 12:39

Re: How add page in page?

19 Sep 2022, 21:21

This works thanks.
 
User avatar
sfernandez
Site Admin
Posts: 2983
Joined: 22 Dec 2011, 19:20

Re: How add page in page?

20 Sep 2022, 10:18

Great, marking this as solved.

Who is online

Users browsing this forum: Google [Bot] and 39 guests