1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using System.Collections.Generic;
using System.Text;
 
namespace Shared.Phone.UserCenter
{
    /// <summary>
    /// 做成一个位于指定控件右上角,进行提示的小型圆形红圈
    /// </summary>
    public class TopRightTipIcon : ButtonCommon
    {
        /// <summary>
        /// 做成一个位于指定控件右上角,进行提示的小型圆形红圈
        /// </summary>
        /// <param name="size">控件大小,理论值</param>
        /// <param name="viewContr">指定位于哪个控件的右上角</param>
        /// <param name="real">是否计算真实值</param>
        public TopRightTipIcon(View viewContr, int size = 60, bool real = false)
        {
            this.InitAvgSize(size, size, real);
            this.Radius = (uint)size / 2;
            this.BackgroundColor = UserCenterColor.Current.Red;
            this.X = viewContr.Right - size / 2;
            this.Y = viewContr.Y - size / 2;
            this.TextAlignment = TextAlignment.Center;
            this.TextColor = UserCenterColor.Current.White;
        }
    }
}