Static Properties and conventions

Nov 26, 2010 at 11:04 AM

Hi,

I have localized textblocks that have the following syntax:

 



<TextBlock x:Name="ScreenStrings_LocalProp" />

The ViewModel looks something like:

public static ScreenStrings ScreenStrings { get; }

and 

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)
                typeList.AddRange(type.GetInterfaces());

            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 ?

 

Thanks,

 

Coordinator
Nov 26, 2010 at 2:23 PM

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