Ejemplo n.º 1
0
        private async void CheckUnreadFollowsMethod()
        {
            if (null == _notify)
            {
                return;
            }

            FollowsVisible = Visibility.Collapsed;

            var result = await _notify.CheckFollowsAsync(LoginUser.Current.Token, "notifications/unread_follows", true);

            ContentsLoading = false;

            if (result == null)
            {
                return;
            }

            if (result.Error != null)
            {
                ToasteIndicator.Instance.Show(String.Empty, result.Error.Message, null, 3);

                Debug.WriteLine(Regex.Unescape(result.Error.Message));

                return;
            }

            Follows.Clear();
            foreach (var item in result.Result.GetItems().Select(item => item as NotifyItem))
            {
                Follows.Add(item);
            }

            FollowsVisible = Follows.Count > 0 ? Visibility.Visible : Visibility.Collapsed;
        }