public ProcessDefaultButton()
        {
            InitializeComponent();

            _viewModel = (ProcessDefaultButtonViewModel)BindingContext;

            MenuButtonText = "Menu";
            CloseMenuText  = "Fechar Menu";

            #region First Button Bindings
            FirstButton.SetBinding(Button.TextProperty, new Binding(nameof(FirstButtonText), source: this));
            FirstButton.SetBinding(Button.IsVisibleProperty, new Binding(nameof(FirstButtonIsVisible), source: this));
            FirstButton.SetBinding(Button.CommandProperty, new Binding(nameof(FirstButtonCommand), source: this));
            #endregion

            #region Second Button Bindings
            SecondButton.SetBinding(Button.TextProperty, new Binding(nameof(SecondButtonText), source: this));
            SecondButton.SetBinding(Button.IsVisibleProperty, new Binding(nameof(SecondButtonIsVisible), source: this));
            SecondButton.SetBinding(Button.CommandProperty, new Binding(nameof(SecondButtonCommand), source: this));
            #endregion

            #region Menu Button Bindings
            MenuButton.SetBinding(Button.TextProperty, new Binding(nameof(MenuButtonText), source: this));
            MenuButton.SetBinding(Button.IsVisibleProperty, new Binding(nameof(MenuButtonIsVisible), source: this));
            MenuButton.Clicked += MenuButtonOnClicked;
            #endregion
        }
        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();
                };

                if (_secondButtonBgColor != Color.Default)
                {
                    Console.WriteLine($"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;
            }
        }
Exemplo n.º 3
0
        private async void Window_Loaded(object sender, RoutedEventArgs e)
        {
            var firstButtonTask  = FirstButton.ClickAsync();
            var secondButtonTask = SecondButton.ClickAsync();
            var labelTask        = TheLabel.MouseEnterAsync();

            await Task.WhenAll(firstButtonTask, secondButtonTask, labelTask);

            TheTextBlock.Text = "Clicked on both buttons and mouse moved over the label";
        }
Exemplo n.º 4
0
 private void ShowSecond()
 {
     First.IsVisible = false;
     MagicCircle.Show(this, 1000, async() =>
     {
         Flash.Show(this);
         Current.CountUpBattle();
         Enemy            = await _vm.GetOtherRandomAsync();
         Second.IsVisible = true;
         SecondButton.Refresh();
     });
 }
Exemplo n.º 5
0
 public void CutBody()
 {
     if (isCorrectPositionSecond(Saw.transform.position.x))
     {
         TrueNumber++;
         SetBodyAnimations(true);
         PlayBodyAnimations();
         PlaySawAnimation();
         CloseSecond.SetActive(false);
         SecondOkay.SetActive(true);
         SecondButton.SetActive(false);
         secondCutted = true;
         CheckTrue();
     }
     else
     {
         WrongPlacePanel.SetActive(true);
     }
 }
        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();
                };
            }
            else
            {
                _secondButton = null;
            }

            _popUp.SetPartContent("button2", _secondButton);
        }
Exemplo n.º 7
0
    private void SetAllButtons(bool active)
    {
        GoBackButton.SetActive(!active);

        if (!firstCutted)
        {
            FirstButton.SetActive(active);
            FirstZoomButton.SetActive(active);
        }
        if (!secondCutted)
        {
            SecondButton.SetActive(active);
            SecondZoomButton.SetActive(active);
        }
        if (!thirdCutted)
        {
            ThirdButton.SetActive(active);
            ThirdZoomButton.SetActive(active);
        }
    }
        void ReleaseDesignerOutlets()
        {
            if (FirstButton != null)
            {
                FirstButton.Dispose();
                FirstButton = null;
            }

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

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