From 11e5bf3a3863149205fa4f1b25b90bbc7c231e0b Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Thu, 9 Mar 2017 22:19:42 +0100 Subject: [PATCH] cx status --- .../ZicMoove/ViewModels/Messaging/ChatViewModel.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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; } } }