xm
2020-05-08 6bca8fcd37a48808a0b9c9342fc1be0adddfece6
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/LoadingControl.cs
New file
@@ -0,0 +1,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;
                    }
                }
            });
        }
    }
}