示例#1
0
 internal override void InitializeOther(UIPanel panel)
 {
     getCoins = new ClickableButton("Collect Coins");
     getCoins.Top.Set(300, 0);
     getCoins.Left.Set(35, 0);
     panel.Append(getCoins);
 }
        public void ShouldCloseParentPopupOnButtonClick()
        {
            Popup parentPopup = new Popup();
            var button = new ClickableButton();
            button.SetValue(ButtonBehaviors.CloseAncestorPopupProperty, true);
            parentPopup.Child = button;

            parentPopup.IsOpen = true;

            button.RaiseClick();

            Assert.IsFalse(parentPopup.IsOpen);
        }
        public void ShouldCloseParentPopupOnButtonClick()
        {
            Popup parentPopup = new Popup();
            var   button      = new ClickableButton();

            button.SetValue(ButtonBehaviors.CloseAncestorPopupProperty, true);
            parentPopup.Child = button;

            parentPopup.IsOpen = true;

            button.RaiseClick();

            Assert.IsFalse(parentPopup.IsOpen);
        }
        public void ShouldCloseAncestorPopupOnButtonClick()
        {
            Popup ancestorPopup = new Popup();
            var button = new ClickableButton();
            button.SetValue(ButtonBehaviors.CloseAncestorPopupProperty, true);
            var immediateParent = new ContentControl();
            immediateParent.Content = button;
            ancestorPopup.Child = immediateParent;

            ancestorPopup.IsOpen = true;

            button.RaiseClick();

            Assert.IsFalse(ancestorPopup.IsOpen);
        }
        public void ShouldCloseAncestorPopupOnButtonClick()
        {
            Popup ancestorPopup = new Popup();
            var   button        = new ClickableButton();

            button.SetValue(ButtonBehaviors.CloseAncestorPopupProperty, true);
            var immediateParent = new ContentControl();

            immediateParent.Content = button;
            ancestorPopup.Child     = immediateParent;

            ancestorPopup.IsOpen = true;

            button.RaiseClick();

            Assert.IsFalse(ancestorPopup.IsOpen);
        }
        internal override void InitializeOther(UIPanel panel)
        {
            craft = new ClickableButton(Language.GetTextValue("LegacyMisc.72"))
            {
                HAlign = 0.2f
            };
            craft.Top.Set(300, 0);
            panel.Append(craft);

            nextRecipe = new ClickableButton(">")
            {
                HAlign = 0.7f
            };
            nextRecipe.Top.Set(300, 0);
            panel.Append(nextRecipe);

            prevRecipe = new ClickableButton("<")
            {
                HAlign = 0.55f
            };
            prevRecipe.Top.Set(300, 0);
            panel.Append(prevRecipe);
        }
 public void AddButton(ClickableButton clickableButton)
 {
     _buttons.Add(clickableButton);
 }