Пример #1
0
        public ProgressbarPopupRenderer()
        {
            _popUp = new Popup(Forms.NativeParent)
            {
                Style       = "circle",
                Orientation = PopupOrientation.Center,
            };
            _popUp.BackButtonPressed     += BackButtonPressedHandler;
            _popUp.TimedOut              += ProgressbarPopup_TimedOutHandler;
            _popUp.Dismissed             += _popUp_Dismissed;
            _popUp.ShowAnimationFinished += _popUp_ShowAnimationFinished;

            _layout = new ElmSharp.Layout(_popUp);
            _layout.SetTheme("layout", "popup", "content/circle");
            _popUp.SetContent(_layout);

            _progressbar = new ElmSharp.ProgressBar(Forms.NativeParent)
            {
                Color = ElmSharp.Color.FromRgb(77, 207, 255),
                //BackgroundColor = Color.FromRgb(100, 255, 0),
                //SpanSize = 50,
                Style       = "process",
                IsPulseMode = true,
            };
            _progressbar.Deleted += _progressbar_Deleted;
            _popUp.SetPartContent("elm.swallow.progress", _progressbar);

            ///////////////
            _popUp2 = new Popup(Forms.NativeParent)
            {
                Style       = "toast/circle/check",
                Orientation = PopupOrientation.Bottom,
                //Timeout = Duration,
            };
            //_popUp2.SetPartText("elm.text", Text);
            _popUp2.TimedOut  += TimedOutHandler;
            _popUp2.Dismissed += _popUp2_Dismissed;
        }
        void BusySetSignalNameHandler(Page sender, bool enabled)
        {
            // Verify that the page making the request is child of this platform
            if (!PageIsChildOfPlatform(sender))
            {
                return;
            }

            if (null == _pageBusyDialog)
            {
                _pageBusyDialog = new Native.Dialog(Forms.NativeParent)
                {
                    Orientation = PopupOrientation.Top,
                };

                var activity = new EProgressBar(_pageBusyDialog)
                {
                    Style       = "process_large",
                    IsPulseMode = true,
                };
                activity.PlayPulse();
                activity.Show();

                _pageBusyDialog.Content = activity;
            }
            _pageBusyCount = Math.Max(0, enabled ? _pageBusyCount + 1 : _pageBusyCount - 1);
            if (_pageBusyCount > 0)
            {
                _pageBusyDialog.Show();
            }
            else
            {
                _pageBusyDialog.Dismiss();
                _pageBusyDialog = null;
            }
        }
Пример #3
0
 public static EProgressBar SetLargeStyle(this EProgressBar progressBar)
 {
     progressBar.Style = ThemeConstants.ProgressBar.Styles.Large;
     return(progressBar);
 }
Пример #4
0
 public static EProgressBar SetSmallStyle(this EProgressBar progressBar)
 {
     progressBar.Style = ThemeConstants.ProgressBar.Styles.Small;
     return(progressBar);
 }