public NewPickupItemPage() { InitializeComponent(); Item = new PickupItem { Title = "Item name" }; BindingContext = this; }
// Note - The Xamarin.Forms Previewer requires a default, parameterless constructor to render a page. public PickupItemDetailPage() { InitializeComponent(); var item = new PickupItem { Title = "New Item posted" }; viewModel = new PickupItemDetailViewModel(item); BindingContext = viewModel; }
public PickupItemDetailViewModel(PickupItem item = null) { Title = item?.Title; Item = item; }