Пример #1
0
 private void UpdateAvatar(string hash)
 {
     if (!Avatar.Exist(hash))
     {
         return;
     }
     UserSetting.VCardPhotoHash = hash;
     UserSettingProvider.Save(UserSetting);
     Dispatcher.BeginInvoke(new Action(() => {
         AvatarImg.AttachSource(Avatar.GetSource(hash), 32, 32);
     }), DispatcherPriority.Normal);
 }
Пример #2
0
        private void RefreshAvatar()
        {
            if (Avatar.Exist(riTo.Presence.PhotoHash))
            {
                AvatarImg.AttachSource(Avatar.GetSource(riTo.Presence.PhotoHash), 32, 32);
            }
            else
            {
                AvatarImg.AttachSource(Icons.UserDefaultAvatarSource, 0, 0);
            }

            AvatarBorder.BorderThickness = new Thickness(1);
            AvatarBorder.BorderBrush     = RosterUtils.Presence2Brush(riTo.Presence.Status);
        }
Пример #3
0
 private void RefreshAvatar()
 {
     if (ViewMode == RosterViewerMode.Default)
     {
         AvatarImg.AttachSource(RosterUtils.Presence2Ico(Presence.Status), null, null);
         AvatarBorder.BorderThickness = new Thickness(0);
     }
     else if (ViewMode == RosterViewerMode.BigAvatar)
     {
         ImageSource avatar = Avatar.Exist(Presence.PhotoHash) ?
                              Avatar.GetSource(Presence.PhotoHash) :
                              Icons.UserDefaultAvatarSource;
         AvatarImg.AttachSource(avatar, 32, 32);
         AvatarBorder.BorderThickness = new Thickness(1);
         AvatarBorder.BorderBrush     = RosterUtils.Presence2Brush(Presence.Status);
     }
 }