View called on exception?

Topics: Bugs
Feb 7, 2012 at 9:43 AM

Hello,

I'm implementing my own exception handling...

I've added on bootstrapper

protected override void OnUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)

      {

          //base.OnUnhandledException(sender, e);

 

          e.Handled = true;

 

          my.Modules.Core.Interfaces.IErrorHandler errorHandle = IoC.Get<my.Modules.Core.Interfaces.IErrorHandler>();

 

 

          Coroutine.BeginExecute(errorHandle.HandleError(e.Exception),null, (s, exception) =>

          {

              e.Handled = true;

 

          });

 

      }

 

my view (activated on a menu click) has

 

protected override void OnViewLoaded(object view)

  {

      base.OnViewLoaded(view);

      LoadData();

  }

 

public void LoadData()

    {

        int i = 0;

        int a=1;

 

 

        i = a/i; //just to throw an exception

}

 

When I execute this code I've the viewloaded called twice (one on the click button, then it's called OnUnhandledException, then called the second time when the Coroutine.BeginExecute is executed... why this happen? I've tried setting e.handled to true/false but with no success

 

Thanks