黄学彪
2020-09-22 ade5917841b0fdcb1df7353ef7c56b1a1bdc9282
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using System;
using System.Collections.Generic;
using System.Text;
 
namespace Shared.Phone.UserCenter
{
    /// <summary>
    /// Loading控件
    /// </summary>
    public class LoadingControl : Button
    {
        /// <summary>
        /// 初始化
        /// </summary>
        public LoadingControl()
        {
            this.Width = HdlControlLogic.Current.GetPictrueRealSize(74);
            this.Height = HdlControlLogic.Current.GetPictrueRealSize(76);
        }
 
        /// <summary>
        /// 开启动画效果
        /// </summary>
        public void StartAction()
        {
            HdlThreadLogic.Current.RunThread(() =>
            {
                int index = 1;
                while (this.Parent != null)
                {
                    System.Threading.Thread.Sleep(50);
                    Application.RunOnMainThread(() =>
                    {
                        this.UnSelectedImagePath = "Loading/" + index + ".png";
                    });
                    index++;
                    if (index > 32)
                    {
                        index = 1;
                    }
                }
            });
        }
    }
}