void OnOptionTap(object sender, OptionEventArgs e)
        {
            BaseMapSectionLabel option = e.Option;

            if (e.Section.Type == SectionType.Language)
            {
                if (currentLanguage != null)
                {
                    currentLanguage.Normalize();
                }

                option.Highlight();

                currentLanguage = option;
            }
            else
            {
                if (current != null)
                {
                    current.Normalize();
                }

                option.Highlight();

                current = option;
            }

            if (OptionTapped != null)
            {
                OptionTapped(null, e);
            }
        }
示例#2
0
        public BaseMapSectionLabel SetFirstItemActive()
        {
            foreach (BaseMapSectionLabel label in optionLabels)
            {
                label.Normalize();
            }

            if (optionLabels.Count > 0)
            {
                BaseMapSectionLabel label = optionLabels[0];
                label.Highlight();

                return(label);
            }

            return(null);
        }
 public void SetInitialItem(Section section)
 {
     foreach (BaseMapSectionMenuItem view in views)
     {
         if (view.Section.Equals(section))
         {
             if (section.Type == SectionType.Language)
             {
                 currentLanguage = view.SetFirstItemActive();
             }
             else
             {
                 current = view.SetFirstItemActive();
             }
         }
     }
 }
        void OnOptionTap(object sender, OptionEventArgs e)
        {
            BaseMapSectionLabel option = e.Option;

            if (e.Section.Type == SectionType.Language)
            {
                if (currentLanguage != null)
                {
                    currentLanguage.Normalize();
                }

                option.Highlight();

                currentLanguage = option;
            }
            else
            {
                if (current != null)
                {
                    current.Normalize();
                }

                option.Highlight();

                current = option;
            }

            if (OptionTapped != null)
            {
                OptionTapped(null, e);
            }
        }
 public void SetInitialItem(Section section)
 {
     foreach (BaseMapSectionMenuItem view in views)
     {
         if (view.Section.Equals(section))
         {
             if (section.Type == SectionType.Language)
             {
                 currentLanguage = view.SetFirstItemActive();
             }
             else
             {
                 current = view.SetFirstItemActive();
             }
         }
     }
 }