private static void OnItemsSourceChanged(BindableObject bindable, IEnumerable oldvalue, IEnumerable newvalue)
 {
     var radButtons = bindable as BindableRadioGroup;
    
     radButtons.rads.Clear();
     radButtons.Children.Clear();
     if (newvalue != null)
     {
       
         int radIndex = 0;
         foreach (var item in newvalue)
         {
             var rad = new CustomRadioButton();
             rad.Text = item.ToString();
             rad.Id = radIndex;  
            
             rad.CheckedChanged += radButtons.OnCheckedChanged;
           
             radButtons.rads.Add(rad);
                             
             radButtons.Children.Add(rad);
             radIndex++;
         }
     }
 }
Example #2
0
        private static void OnItemsSourceChanged(BindableObject bindable, IEnumerable oldvalue, IEnumerable newvalue)
        {
            var radButtons = bindable as BindableRadioGroup;

            radButtons.rads.Clear();
            radButtons.Children.Clear();
            if (newvalue != null)
            {
                int radIndex = 0;
                foreach (var item in newvalue)
                {
                    var rad = new CustomRadioButton();
                    rad.Text = item.ToString();
                    rad.Id   = radIndex;

                    rad.CheckedChanged += radButtons.OnCheckedChanged;

                    radButtons.rads.Add(rad);

                    radButtons.Children.Add(rad);
                    radIndex++;
                }
            }
        }