Esempio n. 1
0
        void ShowActivityIndicatorDialog(bool enabled)
        {
            if (null == _pageBusyDialog)
            {
                _pageBusyDialog = new Native.Dialog(Forms.Context.MainWindow)
                {
                    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;
            }
        }
Esempio n. 2
0
        void OnBusySetRequest(Page sender, bool enabled)
        {
            // Verify that the page making the request is child of this platform
            if (!PageIsInThisContext(sender))
            {
                return;
            }
            _busyCount = Math.Max(0, enabled ? _busyCount + 1 : _busyCount - 1);

            if (null == _pageBusyDialog)
            {
                _pageBusyDialog = new Dialog(MauiContext.GetPlatformParent())
                {
                    Orientation     = PopupOrientation.Center,
                    BackgroundColor = EColor.Transparent
                };

                _pageBusyDialog.SetTitleBackgroundColor(EColor.Transparent);
                _pageBusyDialog.SetContentBackgroundColor(EColor.Transparent);

                var activity = new EProgressBar(_pageBusyDialog)
                {
                    IsPulseMode = true
                }.SetLargeStyle();
                activity.PlayPulse();
                activity.Show();

                _pageBusyDialog.Content = activity;
            }

            if (_busyCount > 0)
            {
                _pageBusyDialog.Show();
            }
            else
            {
                _pageBusyDialog.Dismiss();
                _pageBusyDialog.Unrealize();
                _pageBusyDialog = null;
            }
        }