public static string GetStringByProperty(DependencyProperty prop) { var key = Shortcuts.GetKeyFromValue(prop); // Silverlight does not contain a public Name property on DependencyProperty, so we'll make a unique look-up. #if (SILVERLIGHT) if (key == null) { key = Unknowns.GetKeyFromValue(prop); if (key == null) { key = Guid.NewGuid().ToString(); Unknowns[key] = prop; } } return key; #endif #if (!SILVERLIGHT) return key ?? prop.ToString(); #endif }