Exemplo n.º 1
0
        private static void selectedValuePropertyChanged(BindableObject bindable, object oldValue, object newValue)
        {
            AutoRelateRadioButton target = bindable as AutoRelateRadioButton;

            if (newValue == null)
            {
                return;
            }
            string newValueStr = newValue.ToString();

            if (oldValue != null && oldValue.ToString() == newValueStr)
            {
                return;
            }

            if (target.GroupRelationList != null)
            {
                foreach (AutoRelateRadioButton item in target.GroupRelationList)
                {
                    if (item.Text == newValueStr)
                    {
                        item.IsChecked = true;
                    }
                    else
                    {
                        item.IsChecked = false;
                    }
                }
            }
        }
Exemplo n.º 2
0
        private static void labelMarginPropertyPropertyChanged(BindableObject bindable, object oldValue, object newValue)
        {
            AutoRelateRadioButton target = bindable as AutoRelateRadioButton;
            Thickness             margin = Common.ThicknessUtils.CalcThickness(newValue);

            if (target.mlbl.Margin != margin)
            {
                target.mlbl.Margin = margin;
            }
        }
Exemplo n.º 3
0
        private static void CheckBoxColorPropertyChanged(BindableObject bindable, object oldValue, object newValue)
        {
            AutoRelateRadioButton target = bindable as AutoRelateRadioButton;

            if (target.mckb.Color == (Xamarin.Forms.Color)newValue)
            {
                return;
            }

            target.mckb.Color = (Xamarin.Forms.Color)newValue;
        }
Exemplo n.º 4
0
        private static void fontAttributesPropertyChanged(BindableObject bindable, object oldValue, object newValue)
        {
            AutoRelateRadioButton target = bindable as AutoRelateRadioButton;

            if (target.mlbl.FontAttributes.ToString() == newValue.ToString())
            {
                return;
            }

            target.mlbl.FontAttributes = (FontAttributes) new Converters.FontAttributesConverter().Convert(newValue, null, null, null);
        }
Exemplo n.º 5
0
        private static void textPropertyChanged(BindableObject bindable, object oldValue, object newValue)
        {
            AutoRelateRadioButton target = bindable as AutoRelateRadioButton;

            if (target.mlbl.Text == newValue.ToString())
            {
                return;
            }

            target.mlbl.Text = newValue.ToString();
        }
Exemplo n.º 6
0
        private static void groupIDPropertyChanged(BindableObject bindable, object oldValue, object newValue)
        {
            AutoRelateRadioButton target = bindable as AutoRelateRadioButton;

            if (target.GroupRelationList != null)
            {
                throw new Exception("已经设置了GroupID, 但是又被设置成其他值了");
            }
            string groupID = newValue.ToString();

            AutoRelateRadioButton.GroupByID(groupID, target);
        }
Exemplo n.º 7
0
        public static void GroupByID(string key, AutoRelateRadioButton radioButton)
        {
            List <AutoRelateRadioButton> matchQuery = null;

            if (sDict.TryGetValue(key, out matchQuery) == false)
            {
                matchQuery = new List <AutoRelateRadioButton>();
                sDict.TryAdd(key, matchQuery);
            }

            matchQuery.Add(radioButton);
            radioButton.GroupRelationList = matchQuery;
        }
Exemplo n.º 8
0
        private static void fontSizePropertyChanged(BindableObject bindable, object oldValue, object newValue)
        {
            AutoRelateRadioButton target = bindable as AutoRelateRadioButton;

            if (target.mlbl.FontSize.ToString() == newValue.ToString())
            {
                return;
            }

            double tmp = 0;

            if (double.TryParse(newValue.ToString(), out tmp))
            {
                target.mlbl.FontSize = tmp;
            }
        }