diff --git a/ZicMoove/ZicMoove/ViewModels/Messaging/ChatViewModel.cs b/ZicMoove/ZicMoove/ViewModels/Messaging/ChatViewModel.cs index a2336c3b..306c27c1 100644 --- a/ZicMoove/ZicMoove/ViewModels/Messaging/ChatViewModel.cs +++ b/ZicMoove/ZicMoove/ViewModels/Messaging/ChatViewModel.cs @@ -21,15 +21,20 @@ namespace ZicMoove.ViewModels.Messaging public ConnectionState State { get { return state; } + set + { + SetProperty(ref state, value); + } } public ChatViewModel() { - App.ChatHubConnection.StateChanged += ChatHubConnection_StateChanged; - MainSettings.UserChanged += MainSettings_UserChanged; Messages = new ObservableCollection(); Notifs = new ObservableCollection(); ChatUsers = DataManager.Instance.ChatUsers; + State = App.ChatHubConnection.State; + App.ChatHubConnection.StateChanged += ChatHubConnection_StateChanged; + MainSettings.UserChanged += MainSettings_UserChanged; App.ChatHubProxy.On("addMessage", (n, m) => { Messages.Add(new ChatMessage @@ -93,7 +98,7 @@ namespace ZicMoove.ViewModels.Messaging private void ChatHubConnection_StateChanged(StateChange obj) { - SetProperty(ref state, obj.NewState, "State"); + State = obj.NewState; } } }