NavigationPage 轉換 Page 時,可以透過兩種方式來傳遞資料
App.xaml.cs
using Xamarin.Forms;
namespace NaviData
{
public partial class App : Application
{
public App()
{
InitializeComponent();
MainPage = new NavigationPage(new MainPage());
}
protected override void OnStart()
{
// Handle when your app starts
}
protected override void OnSleep()
{
// Handle when your app sleeps
}
protected override void OnResume()
{
// Handle when your app resumes
}
}
}
Contact Class
namespace NaviData
{
public class Contact
{
public string Name { get; set; }
public int Age { get; set; }
public string Occupation { get; set; }
public string Country { get; set; }
}
}