Exemple #1
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;
        }
Exemple #2
0
        void UpdateSecondButton()
        {
            _secondButton?.Hide();

            if (SecondButton != null)
            {
                _secondButton = new ElmSharp.Button(_popUp)
                {
                    WeightX = 1.0,
                    WeightY = 1.0,
                    Style   = "popup/circle/right"
                };

                if (!string.IsNullOrEmpty(SecondButton.Text))
                {
                    _secondButton.Text = SecondButton.Text;
                }

                if (!SecondButton.IconImageSource.IsNullOrEmpty())
                {
                    var iconSource = SecondButton.IconImageSource as FileImageSource;
                    if (!iconSource.IsNullOrEmpty())
                    {
                        var buttonImage = new ElmSharp.Image(_secondButton);
                        buttonImage.LoadAsync(ResourcePath.GetPath(iconSource));
                        buttonImage.Show();
                        _secondButton.SetPartContent("elm.swallow.content", buttonImage);
                    }
                }

                _secondButton.Clicked += (s, e) =>
                {
                    ((IMenuItemController)SecondButton).Activate();
                };

                if (_secondButtonBgColor != Color.Default)
                {
                    Log.Debug(FormsCircularUI.Tag, $"TwoButtonPopup set second button background color:{_secondButtonBgColor.ToNative()}");
                    _secondButton.BackgroundColor = _secondButtonBgColor.ToNative();
                }

                _popUp.SetPartContent("button2", _secondButton);
            }
            else
            {
                /* This is workaround fix for Left button occupied whole window when right button is null*/
                _secondButton = new ElmSharp.Button(_popUp)
                {
                    WeightX = 1.0,
                    WeightY = 1.0,
                    Style   = "popup/circle/right"
                };
                _popUp.SetPartContent("button2", _secondButton);
                _secondButton.Unrealize();
                _secondButton = null;
            }
        }
Exemple #3
0
        void UpdateSecondButton()
        {
            _secondButton?.Hide();

            if (SecondButton != null)
            {
                _secondButton = new ElmSharp.Button(_popUp)
                {
                    WeightX = 1.0,
                    WeightY = 1.0,
                    Style   = "popup/circle/right"
                };

                if (!string.IsNullOrEmpty(SecondButton.Text))
                {
                    _secondButton.Text = SecondButton.Text;
                }

                if (SecondButton.Icon != null)
                {
                    var iconPath = SecondButton.Icon.File;
                    if (!string.IsNullOrEmpty(iconPath))
                    {
                        var buttonImage = new ElmSharp.Image(_secondButton);
                        buttonImage.LoadAsync(ResourcePath.GetPath(iconPath));
                        buttonImage.Show();
                        _secondButton.SetPartContent("elm.swallow.content", buttonImage);
                    }
                }

                _secondButton.Clicked += (s, e) =>
                {
                    SecondButton.Activate();
                };

                _popUp.SetPartContent("button2", _secondButton);
            }
            else
            {
                /* This is workaround fix for Left button occupied whole window when right button is null*/
                _secondButton = new ElmSharp.Button(_popUp)
                {
                    WeightX = 1.0,
                    WeightY = 1.0,
                    Style   = "popup/circle/right"
                };
                _popUp.SetPartContent("button2", _secondButton);
                _secondButton.Unrealize();
                _secondButton = null;
            }
        }
Exemple #4
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;
        }
        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;
        }
Exemple #6
0
        void UpdateButton()
        {
            _bottomButton?.Hide();

            if (BottomButton != null)
            {
                _bottomButton = new ElmSharp.Button(_popUp)
                {
                    WeightX = 1.0,
                    WeightY = 1.0,
                    Style   = "bottom"
                };

                if (!string.IsNullOrEmpty(BottomButton.Text))
                {
                    _bottomButton.Text = BottomButton.Text;
                }

                if (!BottomButton.IconImageSource.IsNullOrEmpty())
                {
                    var iconSource  = BottomButton.IconImageSource as FileImageSource;
                    var buttonImage = new ElmSharp.Image(_bottomButton);
                    buttonImage.LoadAsync(ResourcePath.GetPath(iconSource));
                    buttonImage.Show();
                    _bottomButton.SetPartContent("elm.swallow.content", buttonImage);
                }

                _bottomButton.Clicked += (s, e) =>
                {
                    (BottomButton as IMenuItemController)?.Activate();
                };

                if (_buttonBgColor != Color.Default)
                {
                    Log.Debug(Circular.Tag, $"InformationPopup set button background color:{_buttonBgColor.ToNative()}");
                    _bottomButton.BackgroundColor = _buttonBgColor.ToNative();
                }
            }
            else
            {
                _bottomButton?.Unrealize();
                _bottomButton = null;
            }

            _popUp.SetPartContent("button1", _bottomButton);
        }