void ReleaseDesignerOutlets() { if (MainToolbar != null) { MainToolbar.Dispose(); MainToolbar = null; } if (PagePopUpButton != null) { PagePopUpButton.Dispose(); PagePopUpButton = null; } if (RefreshButton != null) { RefreshButton.Dispose(); RefreshButton = null; } if (Spinner != null) { Spinner.Dispose(); Spinner = null; } if (TitleTextField != null) { TitleTextField.Dispose(); TitleTextField = null; } }
public void UpdatePagesPopupButton() { PagePopUpButton.AddItem("Page 1"); PagePopUpButton.Activated += delegate { Console.WriteLine(PagePopUpButton.SelectedItem.Title); }; }
void UpdatePagesPopupButton() { foreach (FigmaCanvas canvas in fileProvider.Nodes.OfType <FigmaCanvas>()) { PagePopUpButton.AddItem(canvas.name); } if (Page_ID != null) { PagePopUpButton.SelectItem(Page_ID); } }
public void UpdatePagesPopupButton(FigmaDocument document, int pageIndex) { PagePopUpButton.RemoveAllItems(); foreach (var item in document.children.ToArray()) { PagePopUpButton.AddItem(item.name); PagePopUpButton.Activated += delegate { PageChanged?.Invoke(this, (int)PagePopUpButton.IndexOfSelectedItem); }; } if (pageIndex + 1 > document.children.Length) { PagePopUpButton.SelectItem(0); } else { PagePopUpButton.SelectItem(pageIndex); } }