Exemplo n.º 1
0
        ColorResult BackColorSearch(IViewWrapper view)
        {
            var properties = view.GetType().GetProperties().Where(s => s.Name.StartsWith("BackgroundColor")).ToArray();

            var property = view.GetProperty("BackgroundColor");

            if (property != null)
            {
                var colorFound = property.GetValue(view.Superview) as NSColor;
                return(new ColorResult()
                {
                    View = view, Color = new MacColorWrapper(colorFound)
                });
            }

            if (view.Superview is IViewWrapper superView && superView != null)
            {
                var result = BackColorSearch(superView);
                if (result != null)
                {
                    return(result);
                }
            }
            return(null);
        }