Update: Fixed by telling the observer callbacks to run on the current synchronization context.
.ObserveOn(SynchronizationContext.Current)
So below is the LoginCommand Observable code to fix the above issues. Last line is the edit.
var loggedIn = LoginCommand.RegisterAsync(_ => Observable.Start(() =>
{
Session<NullT> init = new Session<NullT>
{
SqlKey = System.Configuration.ConfigurationManager.AppSettings["sharedKey"].ToString()
};
var initResponse = UserService.Initialize(init);
var authenticationResult = false;
if (initResponse.SessionOk)
{
initResponse.UserIdentity = new User.Identity
{
Login = LoginName,
Password = new User.Password { Old = Password }
};
authenticationResult = UserService.Authenticate(initResponse).Authenticated;
return authenticationResult ? "Login Succeeded"
: "Login Failed...Please try again";
}
else return "Failed to Initialize.";
}).ObserveOn(SynchronizationContext.Current));