private static bool OnViewModelClosed(IViewModel viewModel, object parameter, NavigationProvider provider, bool completeCallback)
        {
            if (provider.CachePolicy != null)
            {
                provider.CachePolicy.Invalidate(viewModel, parameter as IDataContext);
            }
            var closeableViewModel = viewModel as ICloseableViewModel;

            if (closeableViewModel != null)
            {
                var wrapper = closeableViewModel.CloseCommand as CloseCommandWrapper;
                if (wrapper != null)
                {
                    closeableViewModel.CloseCommand = wrapper.NestedCommand;
                }
                closeableViewModel.Closed -= provider._closeViewModelHandler;
            }
            if (completeCallback && provider.CurrentViewModel != viewModel)
            {
                provider.CompleteOperationCallback(viewModel, parameter as IDataContext ?? DataContext.Empty);
                return(true);
            }
            return(false);
        }
 private static bool OnViewModelClosed(IViewModel viewModel, object parameter, NavigationProvider provider, bool completeCallback)
 {
     if (provider.CachePolicy != null)
         provider.CachePolicy.Invalidate(viewModel, parameter as IDataContext);
     var closeableViewModel = viewModel as ICloseableViewModel;
     if (closeableViewModel != null)
     {
         var wrapper = closeableViewModel.CloseCommand as CloseCommandWrapper;
         if (wrapper != null)
             closeableViewModel.CloseCommand = wrapper.NestedCommand;
         closeableViewModel.Closed -= provider._closeViewModelHandler;
     }
     if (completeCallback && provider.CurrentViewModel != viewModel)
     {
         provider.CompleteOperationCallback(viewModel, parameter as IDataContext ?? DataContext.Empty);
         return true;
     }
     return false;
 }