public void FailWithFrameworkException(object sender, ViewRegisteredEventArgs e)
        {
            try
            {
                FailWithInvalidOperationException(sender, e);
            }
            catch (Exception ex)
            {

                throw new FrameworkException(ex);
            }
        }
        private void OnContentRegistered(ViewRegisteredEventArgs e)
        {
            try
            {
                this.contentRegisteredListeners.Raise(this, e);
            }
            catch (TargetInvocationException ex)
            {
                Exception rootException;
                if (ex.InnerException != null)
                {
                    rootException = ex.InnerException.GetRootException();
                }
                else
                {
                    rootException = ex.GetRootException();
                }

                throw new ViewRegistrationException(string.Format(CultureInfo.CurrentCulture,
                                                                  Resources.OnViewRegisteredException, e.RegionName, rootException), ex.InnerException);
            }
        }
예제 #3
0
        private void OnContentRegistered(ViewRegisteredEventArgs e)
        {
            try
            {
                this.contentRegisteredListeners.Raise(this, e);
            }
            catch (TargetInvocationException ex)
            {
                Exception rootException;
                if (ex.InnerException != null)
                {
                     rootException = ex.InnerException.GetRootException();
                }
                else
                {
                    rootException = ex.GetRootException();
                }

                throw new ViewRegistrationException(string.Format(CultureInfo.CurrentCulture,
                    Resources.OnViewRegisteredException, e.RegionName, rootException), ex.InnerException);
            }
        }
 public void FailWithInvalidOperationException(object sender, ViewRegisteredEventArgs e)
 {
     throw new InvalidOperationException("Dont do this");
 }
 public void OnContentRegistered(object sender, ViewRegisteredEventArgs e)
 {
     onViewRegisteredArguments = e;
 }