public override void MovedToWindow()
        {
            base.MovedToWindow();

            if (this.Window == null)              // removed from window - cancel notifications
            {
                NSNotificationCenter.DefaultCenter.RemoveObserver(this);
            }
            else                                     // added to window - register notifications
            {
                if (PopUpViewAnimatedColors != null) // restart color animation if needed
                {
                    PopUpView.SetAnimatedColors(popUpViewAnimatedColors, keyTimes);
                }

                NSNotificationCenter.DefaultCenter.AddObserver(UIApplication.DidBecomeActiveNotification, (obj) =>
                {
                    // ensure animation restarts if app is closed then becomes active again
                    if (popUpViewAnimatedColors != null)
                    {
                        PopUpView.SetAnimatedColors(popUpViewAnimatedColors, keyTimes);
                    }
                });
            }
        }
Esempio n. 2
0
 public void ActiveScreenBlocker(bool active,PopUpView popUpView)
 {
     if (active)
         ScreenBlocker.AddPopUpView(popUpView);
     else
         ScreenBlocker.RemovePopUpView(popUpView);
 }
        void ReleaseDesignerOutlets()
        {
            if (CancelButton != null)
            {
                CancelButton.Dispose();
                CancelButton = null;
            }

            if (PopUpView != null)
            {
                PopUpView.Dispose();
                PopUpView = null;
            }

            if (searchTextField != null)
            {
                searchTextField.Dispose();
                searchTextField = null;
            }

            if (TableView != null)
            {
                TableView.Dispose();
                TableView = null;
            }
        }
        private void UpdatePopUpView()
        {
            CGSize popUpViewSize;
            string valueString = DataSource?.Slider(this, this.Value) ?? "";

            if (!string.IsNullOrWhiteSpace(valueString))
            {
                popUpViewSize = PopUpView.PopUpSizeForString(valueString);
            }
            else
            {
                valueString   = numberFormatter.StringFromNumber(this.Value);
                popUpViewSize = CalculatePopUpViewSize();
            }

            // calculate the popUpView frame
            CGRect thumbRect = ThumbRect();
            nfloat thumbW    = thumbRect.Size.Width;
            nfloat thumbH    = thumbRect.Size.Height;

            CGRect popUpRect = thumbRect.Inset((thumbW - popUpViewSize.Width) / 2, (thumbH - popUpViewSize.Height) / 2);

            popUpRect.Y = thumbRect.Y - popUpViewSize.Height;

            // determine if popUpRect extends beyond the frame of the progress view
            // if so adjust frame and set the center offset of the PopUpView's arrow
            nfloat minOffsetX = popUpRect.GetMinX();
            nfloat maxOffsetX = popUpRect.GetMaxX() - this.Bounds.Width;

            nfloat offset = minOffsetX < 0.0f ? minOffsetX : (maxOffsetX > 0.0f ? maxOffsetX : 0.0f);

            popUpRect.X -= offset;

            PopUpView.SetFrame(popUpRect, offset, valueString);
        }
 private void HidePopUpViewAnimated(bool animated)
 {
     Delegate?.SliderWillHidePopUpView(this);
     PopUpView.HideAnimated(animated, () =>
     {
         Delegate?.SliderDidHidePopUpView(this);
     });
 }
Esempio n. 6
0
 public void AddPopUpView(PopUpView popUp)
 {
     if (!ActivePopUps.Contains(popUp))
     {
         ActivePopUps.Add(popUp);
     }
     UpdateScreenBlockerState();
 }
Esempio n. 7
0
 public void RemovePopUpView(PopUpView popUp)
 {
     if (ActivePopUps.Contains(popUp))
     {
         ActivePopUps.Remove(popUp);
     }
     UpdateScreenBlockerState();
 }
        void ReleaseDesignerOutlets()
        {
            if (btnContentProvider != null)
            {
                btnContentProvider.Dispose();
                btnContentProvider = null;
            }

            if (lblDescription != null)
            {
                lblDescription.Dispose();
                lblDescription = null;
            }

            if (lblPrice != null)
            {
                lblPrice.Dispose();
                lblPrice = null;
            }

            if (lblQuantity != null)
            {
                lblQuantity.Dispose();
                lblQuantity = null;
            }

            if (PopUpOuterView != null)
            {
                PopUpOuterView.Dispose();
                PopUpOuterView = null;
            }

            if (PopUpView != null)
            {
                PopUpView.Dispose();
                PopUpView = null;
            }

            if (ProductImage != null)
            {
                ProductImage.Dispose();
                ProductImage = null;
            }

            if (ProductTitleLable != null)
            {
                ProductTitleLable.Dispose();
                ProductTitleLable = null;
            }

            if (Seprator1 != null)
            {
                Seprator1.Dispose();
                Seprator1 = null;
            }
        }
        private CGSize CalculatePopUpViewSize()
        {
            // negative values need more width than positive values
            var    minStr     = new NSString(NumberFormatter.StringFromNumber(NSNumber.FromFloat(MinValue)));
            CGSize minValSize = PopUpView.PopUpSizeForString(minStr);
            var    maxStr     = new NSString(NumberFormatter.StringFromNumber(NSNumber.FromFloat(MaxValue)));
            CGSize maxValSize = PopUpView.PopUpSizeForString(maxStr);

            return(minValSize.Width >= maxValSize.Width ? minValSize : maxValSize);
        }
 private UIElement CreatePopup()
 {
     PopUpView view = new PopUpView();
     PopUpViewModel viewModel = new PopUpViewModel(
         this.accountsOverviewViewModel,
         this.addAccountDialogViewModel,
         this.eventBroker);
     view.DataContext = viewModel;
     return view;
 }
        public override bool ContinueTracking(UITouch uitouch, UIEvent uievent)
        {
            bool continueTrack = base.ContinueTracking(uitouch, uievent);

            if (continueTrack)
            {
                PopUpView.SetAnimationOffset(CurrentValueOffset, (opaqueReturnColor) =>
                {
                    base.MinimumTrackTintColor = opaqueReturnColor;
                });
            }
            return(continueTrack);
        }
Esempio n. 12
0
        void ReleaseDesignerOutlets()
        {
            if (CloseButton != null)
            {
                CloseButton.Dispose();
                CloseButton = null;
            }

            if (DescriptionLabel != null)
            {
                DescriptionLabel.Dispose();
                DescriptionLabel = null;
            }

            if (ImageView2 != null)
            {
                ImageView2.Dispose();
                ImageView2 = null;
            }

            if (PopupButton1 != null)
            {
                PopupButton1.Dispose();
                PopupButton1 = null;
            }

            if (PopupButton2 != null)
            {
                PopupButton2.Dispose();
                PopupButton2 = null;
            }

            if (PopUpView != null)
            {
                PopUpView.Dispose();
                PopUpView = null;
            }

            if (TitleLabel != null)
            {
                TitleLabel.Dispose();
                TitleLabel = null;
            }
        }
        // if 2 or more colors are present, set animated colors
        // if only 1 color is present then call 'setPopUpViewColor:'
        // if arg is nil then restore previous _popUpViewColor
        public void SetPopUpViewAnimatedColors(UIColor[] colors, NSNumber[] positions)
        {
            if (positions != null && positions.Length != colors.Length)
            {
                throw new ArgumentException("PopUpViewAnimatedColors and locations should contain the same number of items.");
            }

            popUpViewAnimatedColors = colors;
            keyTimes = KeyTimesFromSliderPositions(positions);

            if (colors.Length >= 2)
            {
                PopUpView.SetAnimatedColors(colors, keyTimes);
            }
            else
            {
                PopUpViewColor = colors.Last() ?? popUpViewColor;
            }
        }
 public override void SetValue(float value, bool animated)
 {
     if (animated)
     {
         PopUpView.AnimateBlock((duration) =>
         {
             UIView.Animate(duration, () =>
             {
                 base.SetValue(value, animated);
                 PopUpView.SetAnimationOffset(CurrentValueOffset, (opaqueReturnColor) =>
                 {
                     base.MinimumTrackTintColor = opaqueReturnColor;
                 });
                 LayoutIfNeeded();
             });
         });
     }
     else
     {
         base.SetValue(value, animated);
     }
 }
Esempio n. 15
0
 private void Reset()
 {
     scoreValue = GameObject.Find("ScoreValue").GetComponent <ScoreValue>();
     popUpView  = GameObject.Find("UpperPanel").GetComponent <PopUpView>();
 }
Esempio n. 16
0
    public void ShowPopUpMessage(PopUpInformation popUpInfo)
    {

        PopUpView newPopUp = Instantiate(PopUp, ViewsParent) as PopUpView;
        newPopUp.ActivePopUpView(popUpInfo);
    }
 private void ShowPopUpViewAnimated(bool animated)
 {
     Delegate?.SliderWillDisplayPopUpView(this);
     PopUpView.ShowAnimated(animated);
 }
Esempio n. 18
0
 public override void Awake()
 {
     base.Awake();
     views     = GetComponentsInChildren <MenuView>(true);
     popupView = GetComponentInChildren <PopUpView>(true);
 }