private void TapGestureRecognizer_Tapped(object sender, EventArgs e)
        {
            this.InitialAvatar.BorderColor = this.DefaultAvatar.BorderColor = this.CustomAvatar.BorderColor = this.GroupAvatar.BorderColor = Color.White;
            this.InitialAvatar.BorderWidth = this.DefaultAvatar.BorderWidth = this.CustomAvatar.BorderWidth = this.GroupAvatar.BorderWidth = 6;

            Avatar.SfAvatarView tappedAvatar = (sender as Avatar.SfAvatarView);
            this.AvatarType          = tappedAvatar.ContentType;
            tappedAvatar.BorderColor = Color.Black;
            tappedAvatar.BorderWidth = 2;
        }
 private void ColorTapGestureRecognizer_Tapped(object sender, EventArgs e)
 {
     foreach (var items in ColorItemCollection)
     {
         items.BorderWidth = 1;
         items.BorderColor = Color.White;
     }
     tappedAvatarView             = (sender as Avatar.SfAvatarView);
     tappedAvatarView.BorderWidth = 2;
     tappedAvatarView.BorderColor = Color.FromHex("9E9E9E");
     PenColor = tappedAvatarView.BackgroundColor;
 }
        private void TapGestureRecognizer_Tapped(object sender, EventArgs e)
        {
            tappedAvatarView = (sender as Avatar.SfAvatarView);

            if (tappedAvatarView.ContentType == ContentType.AvatarCharacter)
            {
                SetDefaultAvatar();
            }
            else
            {
                SetColorToAvatar();
            }
        }
        private Avatar.SfAvatarView GetColorPickerItem(Color backgroundColor)
        {
            Avatar.SfAvatarView colorAvatar = new Avatar.SfAvatarView();
            colorAvatar.BackgroundColor   = backgroundColor;
            colorAvatar.BorderWidth       = 1;
            colorAvatar.BorderColor       = Color.White;
            colorAvatar.InitialsColor     = Color.Transparent;
            colorAvatar.AvatarShape       = Avatar.AvatarShape.Circle;
            colorAvatar.AvatarSize        = Avatar.AvatarSize.Medium;
            colorAvatar.VerticalOptions   = LayoutOptions.Center;
            colorAvatar.HorizontalOptions = LayoutOptions.Center;
            TapGestureRecognizer tapGestureRecognizer = new TapGestureRecognizer();

            tapGestureRecognizer.Tapped += ColorTapGestureRecognizer_Tapped;
            colorAvatar.GestureRecognizers.Add(tapGestureRecognizer);
            return(colorAvatar);
        }
        private Avatar.SfAvatarView GetDefinedAvatarItem(String avatar)
        {
            Avatar.SfAvatarView defaultAvatar = new Avatar.SfAvatarView();
            defaultAvatar.AvatarShape       = AvatarShape.Circle;
            defaultAvatar.AvatarSize        = AvatarSize.Medium;
            defaultAvatar.VerticalOptions   = LayoutOptions.Center;
            defaultAvatar.HorizontalOptions = LayoutOptions.Center;
            defaultAvatar.BorderWidth       = 5;
            defaultAvatar.BorderColor       = Color.White;
            defaultAvatar.ContentType       = ContentType.AvatarCharacter;
            defaultAvatar.AvatarCharacter   = (AvatarCharacter)Enum.Parse(typeof(AvatarCharacter), avatar, true);

            TapGestureRecognizer tapGestureRecognizer = new TapGestureRecognizer();

            tapGestureRecognizer.Tapped += TapGestureRecognizer_Tapped;
            defaultAvatar.GestureRecognizers.Add(tapGestureRecognizer);

            return(defaultAvatar);
        }