/// <summary> /// /// </summary> public static void WireUpControls(this AppCompatActivity This) { var members = This.GetType().GetRuntimeProperties() .Where(m => m.PropertyType.IsSubclassOf(typeof(View))); members.ToList().ForEach(m => { try { // Find the android control with the same name var view = This.getControlInternal(m.PropertyType, m.Name); // Set the activity field's value to the view with that identifier m.SetValue(This, view); } catch (Exception ex) { throw new MissingFieldException("Failed to wire up the Property " + m.Name + " to a View in your layout with a corresponding identifier", ex); } }); }