Hello,
Welcome to our Microsoft Q&A platform!
If you just want to pass data, there are some other good ways you could try. For example, the Application subclass has a static Properties
dictionary which can be used to store data.
//store the data
Application.Current.Properties ["id"] = someClass.ID;
//retrive the value
if (Application.Current.Properties.ContainsKey("id"))
{
var id = Application.Current.Properties ["id"] as int;
// do something with id
}
Or use Xamarin.Essentials.Preferences to store application preferences in a key/value store.
//save the value to preferences
Preferences.Set("my_key", "my_value");
//retrieve a value from preferences or a default if not set:
var myValue = Preferences.Get("my_key", "default_value");
Best Regards,
Jarvan Zhang
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.