Пример #1
0
 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);
            }
        }