private void ChangeUserStatusText(UserConnectionStatusNotification obj)
        {
            if (string.IsNullOrEmpty(obj.fields.message))
            {
                switch (obj.fields.status)
                {
                case "offline":
                    Users.FirstOrDefault(x => x.Id == obj.fields.userId).UserPresence.StatusText = "Offline";
                    break;

                case "online":
                    Users.FirstOrDefault(x => x.Id == obj.fields.userId).UserPresence.StatusText = "Online";
                    break;

                case "away":
                    Users.FirstOrDefault(x => x.Id == obj.fields.userId).UserPresence.StatusText = "Zaraz wracam";
                    break;

                case "busy":
                    Users.FirstOrDefault(x => x.Id == obj.fields.userId).UserPresence.StatusText = "Zajęty";
                    break;
                }
            }
            else
            {
                Users.FirstOrDefault(x => x.Id == obj.fields.userId).UserPresence.StatusText = obj.fields.message;
            }
        }
        private void ChangeCurrentStatus(UserConnectionStatusNotification obj)
        {
            switch (obj.fields.status)
            {
            case "offline":
                CurrentStatusMenuDotColor = new SolidColorBrush(Colors.Gray);
                break;

            case "online":
                CurrentStatusMenuDotColor = new SolidColorBrush(Colors.LightGreen);
                break;

            case "away":
                CurrentStatusMenuDotColor = new SolidColorBrush(Colors.Orange);
                break;

            case "busy":
                CurrentStatusMenuDotColor = new SolidColorBrush(Colors.Red);
                break;

            default:
                break;
            }
            if (obj.fields.message != null)
            {
                if (obj.fields.message == string.Empty)
                {
                    switch (obj.fields.status)
                    {
                    case "offline":
                        LoggedUser.UserPresence.StatusText = "Niewidoczny";
                        break;

                    case "online":
                        LoggedUser.UserPresence.StatusText = "Online";
                        break;

                    case "away":
                        LoggedUser.UserPresence.StatusText = "Zaraz wracam";
                        break;

                    case "busy":
                        LoggedUser.UserPresence.StatusText = "Zajęty";
                        break;
                    }
                }
                else
                {
                    LoggedUser.UserPresence.StatusText = obj.fields.message;
                }
            }
        }
 private async void UserConnectionStatusChangedHandler(UserConnectionStatusNotification obj)
 {
     if (obj.fields.userId == LoggedUser.Id)
     {
         await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
         {
             LoggedUser.UserPresence.Status = obj.fields.status;
             ChangeCurrentStatus(obj);
         });
     }
     else
     {
         await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
         {
             Users.FirstOrDefault(x => x.Id == obj.fields.userId).UserPresence.Status = obj.fields.status;
             ChangeUserStatusText(obj);
         });
     }
 }