private void OnSessionStateChanged(XmppSessionState newState) { this.Dispatcher.BeginInvoke ( DispatcherPriority.ApplicationIdle, new ThreadStart ( delegate { switch (newState) { case XmppSessionState.LoggedIn: VisualStateManager.GoToState(this, "LoggedIn", true); break; case XmppSessionState.LoggingIn: VisualStateManager.GoToState(this, "LoggingIn", false); break; case XmppSessionState.LoggingOut: VisualStateManager.GoToState(this, "LoggingOut", true); break; case XmppSessionState.Error: VisualStateManager.GoToState(this, "Error", true); break; } } ) ); }
protected virtual void OnSessionStateChanged(XmppSessionState newState) { SubscribeToSessionState(); if (newState == XmppSessionState.LoggingIn) { Subscribe(); } else if (newState == XmppSessionState.LoggingOut) { Unsubscribe(); } //NotifyAllPropertiesChanged(); }
private void OnSessionStateChanged(XmppSessionState newState) { if (newState == XmppSessionState.LoggingIn) { this.Subscribe(); } else if (newState == XmppSessionState.LoggingOut) { this.Unsubscribe(); } }
protected virtual void OnSessionStateChanged(XmppSessionState newState) { SubscribeToSessionState(); if (newState == XmppSessionState.LoggingIn) { Subscribe(); } else if (newState == XmppSessionState.LoggingOut) { Unsubscribe(); } //NotifyAllPropertiesChanged(); }
private void OnSessionStateChanged(XmppSessionState newState) { Application.Current.Dispatcher.Invoke ( (Action)delegate { if (newState == XmppSessionState.LoggedIn) { this.Password = String.Empty; } else if (newState == XmppSessionState.LoggedOut) { this.NotifyPropertyChanged(() => Accounts); } } ); }
private void OnSessionStateChanged(XmppSessionState newState) { lock (SyncObject) { List<string> removedViews = new List<string>(); IEnumerator<KeyValuePair<string, PivotItem>> enumerator = this.chatViews.GetEnumerator(); while (enumerator.MoveNext()) { removedViews.Add(enumerator.Current.Key); } foreach (string jid in removedViews) { this.CloseChatView(jid); } } this.Unsubscribe(); }