コード例 #1
0
        private void CompleteClose()
        {
            INavigationContext context = CreateCloseContext();

            OnClosed(_closeParameter, context);

            bool?result          = null;
            var  operationResult = ViewModel as IHasOperationResult;

            if (operationResult != null)
            {
                result = operationResult.OperationResult;
            }
            OperationCallbackManager.SetResult(ViewModel,
                                               OperationResult.CreateResult(OperationType.WindowNavigation, ViewModel, result, context));

            _closeParameter = null;
            _shouldClose    = false;
            _isOpen         = false;
            TView view = View;

            if (view == null)
            {
                return;
            }
            ThreadManager.InvokeOnUiThreadAsync(() =>
            {
                CleanupView(view);
                _viewManager
                .CleanupViewAsync(ViewModel)
                .WithTaskExceptionHandler(ViewModel);
            });
            View = null;
        }