Example #1
0
        public void Dismiss()
        {
            if (_firstButton != null)
            {
                _firstButton.Unrealize();
                _firstButton = null;
                _popUp.SetPartContent("button1", null);
            }

            if (_secondButton != null)
            {
                _secondButton.Unrealize();
                _secondButton = null;
                _popUp.SetPartContent("button2", null);
            }

            if (_nativeContent != null)
            {
                _nativeContent.Unrealize();
                _nativeContent = null;
            }

            if (_popUp != null)
            {
                _layout.Unrealize();
                _layout = null;
                _popUp.Unrealize();
                _popUp = null;
            }
        }
Example #2
0
        /// <summary>
        /// ToastRenderer class constructor.
        /// Creates an instance of EPopup class.
        /// Executes UpdateText and UpdateDuration methods.
        /// </summary>
        public ToastRenderer()
        {
            _control = new EPopup(Forms.NativeParent)
            {
                Style       = DefaultStyle,
                AllowEvents = true,
            };

            UpdateText();
            UpdateDuration();
        }
        public DialogImplementation()
        {
            _control = new EPopup(TForms.NativeParent);

            _control.ShowAnimationFinished += ShowAnimationFinishedHandler;
            _control.Dismissed             += DismissedHandler;
            _control.OutsideClicked        += OutsideClickedHandler;
            _control.BackButtonPressed     += BackButtonPressedHandler;

            _contentView = new StackLayout();
        }
Example #4
0
        public ToastImplementation()
        {
            _control = new EPopup(TForms.Context.MainWindow)
            {
                Style       = DefaultStyle,
                AllowEvents = true,
            };

            UpdateText();
            UpdateDuration();
        }
Example #5
0
        public InformationPopupImplementation()
        {
            _popUp       = new ElmSharp.Popup(TForms.NativeParent);
            _popUp.Style = "circle";

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

            _popUp.BackButtonPressed += BackButtonPressedHandler;
        }
Example #6
0
        public TwoButtonPopupImplementation()
        {
            _popUp       = new ElmSharp.Popup(XForms.NativeParent);
            _popUp.Style = "circle";

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

            _popUp.BackButtonPressed += BackButtonPressedHandler;
            _popUp.Dismissed         += OnDismissed;

            _contentView = new StackLayout();
        }
Example #7
0
        public ToastImplementation()
        {
            _control = new ElmSharp.Popup(TForms.NativeParent)
            {
                Style       = DefaultStyle,
                AllowEvents = true,
            };

            _control.BackButtonPressed += (s, e) => _control.Dismiss();
            _control.TimedOut          += (s, e) => _control.Dismiss();
            _control.OutsideClicked    += (s, e) => _control.Dismiss();

            UpdateIcon();
            UpdateText();
            UpdateDuration();
        }
        protected virtual void Dispose(bool disposing)
        {
            if (_isDisposed)
            {
                return;
            }

            if (disposing)
            {
                if (_nativePositive != null)
                {
                    _nativePositive.Unrealize();
                    _nativePositive = null;
                }

                if (_nativeNeutral != null)
                {
                    _nativeNeutral.Unrealize();
                    _nativeNeutral = null;
                }

                if (_nativeNegative != null)
                {
                    _nativeNegative.Unrealize();
                    _nativeNegative = null;
                }

                if (_nativeContent != null)
                {
                    _nativeContent.Unrealize();
                    _nativeContent = null;
                }

                if (_control != null)
                {
                    _control.ShowAnimationFinished -= ShowAnimationFinishedHandler;
                    _control.Dismissed             -= DismissedHandler;
                    _control.OutsideClicked        -= OutsideClickedHandler;
                    _control.BackButtonPressed     -= BackButtonPressedHandler;

                    _control.Unrealize();
                    _control = null;
                }
            }

            _isDisposed = true;
        }
Example #9
0
        protected virtual void Dispose(bool disposing)
        {
            if (_isDisposed)
            {
                return;
            }

            if (disposing)
            {
                if (_bottomButton != null)
                {
                    _bottomButton.Unrealize();
                    _bottomButton = null;
                }

                if (_box != null)
                {
                    _box.Unrealize();
                    _box = null;
                }

                if (_progress != null)
                {
                    _progress.Unrealize();
                    _progress = null;
                }

                if (_progressLabel != null)
                {
                    _progressLabel.Unrealize();
                    _progressLabel = null;
                }

                if (_popUp != null)
                {
                    _layout.Unrealize();
                    _layout = null;
                    _popUp.BackButtonPressed -= BackButtonPressedHandler;
                    _popUp.Unrealize();
                    _popUp = null;
                }
            }

            _isDisposed = true;
        }
Example #10
0
        /// <summary>
        /// Disposes the toast.
        /// </summary>
        /// <param name="isDisposing">Flag indicating if the toast is already in progress of disposing.</param>
        protected virtual void Dispose(bool isDisposing)
        {
            if (_isDisposed)
            {
                return;
            }

            if (isDisposing)
            {
                if (_control != null)
                {
                    _control.Unrealize();
                    _control = null;
                }
            }

            _isDisposed = true;
        }
Example #11
0
        protected virtual void Dispose(bool disposing)
        {
            if (_isDisposed)
            {
                return;
            }

            if (disposing)
            {
                if (_firstButton != null)
                {
                    _firstButton.Unrealize();
                    _firstButton = null;
                }

                if (_secondButton != null)
                {
                    _secondButton.Unrealize();
                    _secondButton = null;
                }

                if (_nativeContent != null)
                {
                    _nativeContent.Unrealize();
                    _nativeContent = null;
                }

                if (_popUp != null)
                {
                    _layout.Unrealize();
                    _layout = null;
                    _popUp.Unrealize();
                    _popUp = null;
                }
            }

            _isDisposed = true;
        }
Example #12
0
        public void Dismiss()
        {
            _popUp.Hide();

            if (_bottomButton != null)
            {
                _bottomButton.Unrealize();
                _bottomButton = null;
                _popUp.SetPartContent("button1", null);
            }

            if (_box != null)
            {
                _box.Unrealize();
                _box = null;
            }

            if (_progress != null)
            {
                _progress.Unrealize();
                _progress = null;
            }

            if (_progressLabel != null)
            {
                _progressLabel.Unrealize();
                _progressLabel = null;
            }

            if (_popUp != null)
            {
                _layout.Unrealize();
                _layout = null;
                _popUp.BackButtonPressed -= BackButtonPressedHandler;
                _popUp.Unrealize();
                _popUp = null;
            }
        }