private static MethodInfo GetMethod(string name, TypeInfo widgetType)
{
#if NET451
return widgetType.AsType().GetMethod(name, BindingFlags.Public | BindingFlags.Instance);
#else
var method = widgetType.AsType().GetMethod(name);
return method != null && method.IsStatic ? null : method;
#endif
}