public void OpenDialog(DialogViewModelBase viewModel, string dialogIdentifier) { UIElement view = _viewManager.CreateViewForModel(viewModel); DialogHost.Show(view, dialogIdentifier, viewModel.OnDialogClosed); viewModel.DialogViewModelHost = this; ActiveDialogViewModel = viewModel; IsOpen = true; }
private async Task <object> ShowDialog(string identifier, DialogViewModelBase viewModel) { Task <object> result = null; await Execute.OnUIThreadAsync(() => { UIElement view = _viewManager.CreateViewForModel(viewModel); _viewManager.BindViewToModel(view, viewModel); if (identifier == null) { result = DialogHost.Show(view, viewModel.OnDialogOpened, viewModel.OnDialogClosed); } else { result = DialogHost.Show(view, identifier, viewModel.OnDialogOpened, viewModel.OnDialogClosed); } }); return(await result); }
private async Task <object?> ShowDialog(string?identifier, DialogViewModelBase viewModel) { Task <object?>?result = null; await Execute.OnUIThreadAsync(() => { UIElement view = _viewManager.CreateViewForModel(viewModel); _viewManager.BindViewToModel(view, viewModel); if (identifier == null) { result = DialogHost.Show(view, viewModel.OnDialogOpened, viewModel.OnDialogClosed); } else { result = DialogHost.Show(view, identifier, viewModel.OnDialogOpened, viewModel.OnDialogClosed); } }); if (result == null) { throw new ArtemisSharedUIException("Failed to show dialog host"); } return(await result); }