Your pop-up window is perfect, but at the moment when I execute it, I do n’t know where the problem is
async void OnItemSelected(object sender, SelectedItemChangedEventArgs args)
{
var item = args.SelectedItem as Item;
if (item == null)
return;
var ret = await Dialog.Instance.ShowAsync<MyDialogView>(new { Title = "Hello" });
// If canceled, ret is false; Otherwise is true.
// Optionally, view model can be passed to the dialog view instance.
// When the dialog is closed, all related resource automatically are disposed.
// Also, IReusableDialog that keeps the state can be created.
var reusableDialog = Dialog.Instance.Create<MyDialogView>();
ret = await reusableDialog.ShowAsync();
// Even if the dialog is closed, disposing process is not executed.
if(ret)
{
await Navigation.PushAsync(new ItemDetailPage(new ItemDetailViewModel(item)));
}
else
{
}
// ShowAsync can be used any number of times until disposing it.
reusableDialog.Dispose();
// Manually deselect item.
ItemsListView.SelectedItem = null;
}
The Error is:
System.NullReferenceException: 'Object reference not set to an instance of an object.'
Your pop-up window is perfect, but at the moment when I execute it, I do n’t know where the problem is
async void OnItemSelected(object sender, SelectedItemChangedEventArgs args) { var item = args.SelectedItem as Item; if (item == null) return;
The Error is: System.NullReferenceException: 'Object reference not set to an instance of an object.'