Click here to Skip to main content
15,885,244 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i need to transfer data into xaml page, but i don't understand how can do it??

What I have tried:

Frame frame = new Frame();
frame.Navigate(typeof(demoProject.pageName), listofdata);
Window.Current.Content = frame;
Window.Current.Activate()

* How can receive data in Page ???
Posted
Updated 5-May-19 20:31pm

1 solution

This is typically done with Data Binding, see: Data binding overview - Windows UWP applications | Microsoft Docs[^]

To receive parameters in another page you can use OnNavigatedTo(NavigationEventArgs e)
protected override void OnNavigatedTo(NavigationEventArgs e)
{
    if (e.Parameter is string && !string.IsNullOrWhiteSpace((string)e.Parameter))
    {
        greeting.Text = $"Hi, {e.Parameter.ToString()}";
    }
    else
    {
        greeting.Text = "Hi!";
    }
    base.OnNavigatedTo(e);
}

For the complete example, see: Peer-to-peer navigation between two pages - Windows UWP applications | Microsoft Docs[^]
 
Share this answer
 
v2
Comments
Er.RajeshKumar 7-May-19 0:09am    
i need to transfer class parameter into xaml.cs page

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900