Hi Grime,
Welcome to our Microsoft Q&A platform!
You should create the constructor for OperatorModel, rather than NewOperatorPage.
The following is the simple demo.
OperatorModel.cs
class OperatorModel
{
public string OperatorName { get; set; }
public OperatorModel(string ope)
{
OperatorName = ope;
}
}
MainPage.xaml.cs
private async void AddOperatorButton_Clicked(object sender, EventArgs e)
{
string newOp = await DisplayPromptAsync("Enter New Operator", "New Operator Name/Callsign (no spaces)");
if (newOp != null)
{
await Navigation.PushModalAsync(new NewOperatorPage()
{
BindingContext = new OperatorModel(newOp)
});
}
}
Regards,
Kyle
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
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.