Static Properties and conventions

Nov 26, 2010 at 10:04 AM


I have localized textblocks that have the following syntax:


<TextBlock x:Name="ScreenStrings_LocalProp" />

The ViewModel looks something like:

public static ScreenStrings ScreenStrings { get; }


public static class ScreenStrings
 public static string LocalProp { get; set; }

I've noticed however that the convention was not working, so I snooped around in the caliburn source code and found this little pice in the ViewBinding class:

 public static PropertyInfo GetPropertyCaseInsensitive(this Type type, string propertyName) {
            var typeList = new List<Type> { type };

            if (type.IsInterface)

            return typeList
                .Select(interfaceType => interfaceType.GetProperty(propertyName, BindingFlags.IgnoreCase | BindingFlags.Public | BindingFlags.Instance))
                .FirstOrDefault(property => property != null);

Now, this is nice, but It misses  | BindingFlags.Static, any reason for that ?




Nov 26, 2010 at 1:23 PM

I can't remember off hand. I'll investigate and see about adding that. Creating a ticket to remind me.