Using masterpage-like in Xaml? [SOLVED]

Alex
Posts: 2
Joined: Mon Apr 27, 2015 6:08 am

Using masterpage-like in Xaml? [SOLVED]

Postby Alex » Mon Apr 27, 2015 6:16 am

Hello. C#/XAML for HTML5 seems to be very nice. :D

I have just started with a new test Project and have not much knownledge about web developing but if I want a master page like structure, how would I do that in Xaml?

I was doing like this:

Code: Select all

<Grid Name="PageContent" >
    <!-- Page here -->
</Grid>


Code: Select all

public void OpenPage(UserControl page)
{
 PageContent.Children.Clear();
 PageContent.Children.Add(page);
}


The problem is that the variable PageContent do not exist even when Grid has the name PageContent.
How should I do? Is there a better alternative to open a page in a "MasterPage" ?

JS-Support @Userware
Site Admin
Posts: 1142
Joined: Tue Apr 08, 2014 3:42 pm

Re: Using masterpage-like in Xaml?

Postby JS-Support @Userware » Mon Apr 27, 2015 7:30 am

Hello,

Welcome to the forums.

You must type x:Name="PageContent" instead of Name="PageContent"

Also, make sure to save the XAML file in order for VS to not display any errors in the code behind.

In Beta 4 we are going to improve it so that you can also use the syntax without the "x:".

Regards,
JS-Support

Alex
Posts: 2
Joined: Mon Apr 27, 2015 6:08 am

Re: Using masterpage-like in Xaml?

Postby Alex » Mon Apr 27, 2015 8:28 am

Ohh thanks, now it works :)

JS-Support @Userware
Site Admin
Posts: 1142
Joined: Tue Apr 08, 2014 3:42 pm

Re: Using masterpage-like in Xaml?

Postby JS-Support @Userware » Tue Apr 28, 2015 4:36 am

You are welcome :-)

JS-Support


Return to “General Discussion and Other”

Who is online

Users browsing this forum: No registered users and 30 guests

 

 

cron