示例#1
0
        protected virtual void Refresh()
        {
            if (IsShowing)
            {
                return;
            }

            var   txt = Title;
            float p   = -1;

            if (IsDeterministic)
            {
                p = (float)PercentComplete / 100;

                if (!string.IsNullOrWhiteSpace(txt))
                {
                    txt += "... ";
                }
                txt += PercentComplete + "%";
            }

            var bounds = new RectangleF((float)UIScreen.MainScreen.Bounds.Left, (float)UIScreen.MainScreen.Bounds.Top, (float)UIScreen.MainScreen.Bounds.Width, (float)UIScreen.MainScreen.Bounds.Height);

            if ((UIApplication.SharedApplication.StatusBarOrientation == UIInterfaceOrientation.LandscapeLeft) || (UIApplication.SharedApplication.StatusBarOrientation == UIInterfaceOrientation.LandscapeRight))
            {
                bounds.Size = new SizeF((float)UIScreen.MainScreen.Bounds.Width, (float)UIScreen.MainScreen.Bounds.Height);
            }

            _LoadingOverlay = new LoadingOverlay(bounds);
            UIView view = Utilities.GetTopView();

            view.Add(this._LoadingOverlay);
        }