protected override void OnLoad(System.EventArgs e) { base.OnLoad(e); // Make button text editable in on-page edit mode ButtonLink.ApplyEditAttributes <ButtonBlock>(b => b.ButtonText); DataBind(); }
public static void UpdateButtonLink(this ButtonLink btnLink, ButtonLinkViewModel btnLinkVm) { btnLink.ID = btnLinkVm.ID; btnLink.Type = btnLinkVm.Type; btnLink.Title = btnLinkVm.Title; btnLink.Url = btnLinkVm.Url; btnLink.SizeHeight = btnLinkVm.SizeHeight; btnLink.Index = btnLinkVm.Index; }
void UpdatePanel() { //turn to list TextMeshProUGUI[] textBoxes; textBoxes = copyPanel.transform.GetChild(0).transform.GetComponentsInChildren <TextMeshProUGUI>(); for (int i = 0; i < textBoxes.Length; i++) { if (textBoxes[i].gameObject.name == "Title") { textBoxes[i].SetText(title); } else if (textBoxes[i].gameObject.name == "Description") { if (itemUpgradeSection == "Production") { textBoxes[i].SetText(description + "\n" + "Social: " + social + "\n" + "Environmental: " + environmental + "\n" + "Recycling Percent: " + productionQuantity + "%"); } else { textBoxes[i].SetText(description + "\n" + "Social: " + social + "\n" + "Environmental: " + environmental); } } } TextMeshProUGUI altdescPanel = copyPanel.transform.GetChild(1).transform.GetComponentInChildren <TextMeshProUGUI>(); if (altdescPanel.gameObject.name == "altDesc") { altdescPanel.SetText(altDescription); } // Button[] buttons; buttons = copyPanel.transform.GetChild(0).transform.GetComponentsInChildren <Button>(); for (int i = 0; i < buttons.Length; i++) { if (buttons[i].gameObject.name == "Purchase") { TextMeshProUGUI purchaseText = buttons[i].gameObject.transform.GetChild(0).GetComponent <TextMeshProUGUI>(); purchaseText.SetText("Purchase for £" + cost + "K"); } } TextMeshProUGUI[] predicted = copyPanel.transform.GetChild(2).transform.GetComponentsInChildren <TextMeshProUGUI>(); for (int i = 0; i < predicted.Length; i++) { if (predicted[i].name == "Stats") { predicted[i].SetText("Cash: £" + (gameManager.money - cost * upgradeNumber) + "K" + "\n" + "Social: " + (gameManager.social + (social * upgradeNumber)) + "\n" + "Environmental: " + (gameManager.environment + (environmental * upgradeNumber)) + "\n"); } } ButtonLink calcProductNo = copyPanel.transform.GetChild(0).transform.GetChild(5).GetComponent <ButtonLink>(); calcProductNo.GetupgradeLink(this); }
public void WhenButtonLinkInvoked_ThenViewModelIsUpdated(string key, string value) { var values = new Dictionary <string, string>() { { key, value } }; var component = new ButtonLink(); component.ViewComponentContext = ViewComponentTestHelper.GetViewComponentContext(); ViewViewComponentResult result = component.Invoke(values) as ViewViewComponentResult; LinkModel resultModel = (LinkModel)result.ViewData.Model; //Assert value.Should().Be(ViewComponentTestHelper.GetPropertyValue(resultModel, key)); }
public void ApplyTo(ButtonLink applyTo) { applyTo.Url = Url; applyTo.EventName = EventName; applyTo.SendEvent = SendEvent; }
public ButtonLink AddButtonLink(ButtonLink btnLink) { return(_buttonLinkRepository.Add(btnLink)); }