예제 #1
0
        public static UILabel findFirstLabelWithBkgColor(UIView view, UIColor color)
        {
            UILabel result = null;

            foreach (UIView subview in view.Subviews)
            {
                if (subview.GetType() == typeof(UILabel))
                {
                    if (color.Equals(((UILabel)subview).BackgroundColor))
                    {
                        return((UILabel)subview);
                    }
                }
                var _subview = subview;

                if (_subview.Subviews.Length > 0)
                {
                    result = findFirstLabelWithBkgColor(_subview, color);
                    if (result != null && color.Equals(((UILabel)result).BackgroundColor))
                    {
                        return(result);
                    }
                }
            }

            return(result);
        }
예제 #2
0
        public void Add()
        {
            var color = ((MovieViewModel)DataContext).TextColor;

            if (UIColor.Equals(color, UIColor.Red))
            {
                color = UIColor.Green;
            }
            else
            {
                color = UIColor.Red;
            }
        }
        public MyDataModel(IEnumerable items, Action <int> selectedHandler, UIColor textColor)
        {
            _selectedHandler = selectedHandler;

            if (items != null)
            {
                foreach (object item in items)
                {
                    _list.Add(item.ToString());
                }
            }
            if (!textColor.Equals(Color.Default.ToUIColor()))
            {
                TextColor = textColor;
            }
        }
예제 #4
0
 private bool ComapareColors(UIColor color1, UIColor color2)
 {
     return(color1.Equals(color2));
 }