Ejemplo n.º 1
0
 public void InitializeUnselect()
 {
     if (Id == 0 || Id == 1 || Id == 7 || Id == 8)
     {
         // 禁选英雄选择,增加[未选择]
         ItemsInfos.Insert(0, new ComboBoxItemInfo
         {
             Id      = "0",
             Name    = L("NO_CHOOSE"),
             Acronym = ""
         });
     }
 }
Ejemplo n.º 2
0
        protected override void OnViewLoaded()
        {
            if (Id == 0 || Id == 1 || Id == 7 || Id == 8)
            {
                // 禁选英雄选择,增加[未选择]

                ItemsInfos.Insert(0, new ComboBoxItemInfo()
                {
                    Id      = "",
                    Name    = L("NO_CHOOSE"),
                    Acronym = "",
                });
            }
            base.OnViewLoaded();
        }
Ejemplo n.º 3
0
        public void Select(string name)
        {
            var selectedItem = ItemsInfos.FirstOrDefault(c => c.Name == name);

            if (selectedItem != null)
            {
                SelectedItemInfo = selectedItem;
            }
            else
            {
                ItemsInfos.Insert(0, new ComboBoxItemInfo
                {
                    Id      = "0",
                    Name    = name,
                    Acronym = ""
                });
                SelectedItemInfo = ItemsInfos[0];
            }
        }