黄学彪
2020-12-16 0d9f64668fd7350d6a21fd157e32009a96d98134
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
{
    /// <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);
                    HdlThreadLogic.Current.RunMain(() =>
                    {
                        this.UnSelectedImagePath = "Loading/" + index + ".png";
                    }, ShowErrorMode.NO);
                    index++;
                    if (index > 32)
                    {
                        index = 1;
                    }
                }
            });
        }
    }
}