I am fairly new to programming in Maui. Previously, I wrote android applications in Xamarin. I have question. How to transfer variables between two Content Page. I try this way:
I have two content page, MainPage and SettingsPage. This is how I send data to SettingsPage:
public async void goToSettingsPage_button_Clicked(object sender, EventArgs e)
{
await Navigation.PushAsync(new DetailsPage(language));
}
And this is how I perceive them:
public partial class SettingsPage : ContentPage
{
public SettingsPage(string language)
{
InitializeComponent();
String Language = language;
}
}
I just used Intent on xamarin. PutExtra or Intent.GetExtra. I don't know how to work in Maui. How to pass a variable back from SettingsPage to MainPage. I tried to do it in the same way as above;