Page 1 of 1

Using masterpage-like in Xaml? [SOLVED]

Posted: Mon Apr 27, 2015 6:16 am
by Alex
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" ?

Re: Using masterpage-like in Xaml?

Posted: Mon Apr 27, 2015 7:30 am
by JS-Support @Userware
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

Re: Using masterpage-like in Xaml?

Posted: Mon Apr 27, 2015 8:28 am
by Alex
Ohh thanks, now it works :)

Re: Using masterpage-like in Xaml?

Posted: Tue Apr 28, 2015 4:36 am
by JS-Support @Userware
You are welcome :-)

JS-Support