System.Windows.DependencyProperty.ToString C# (CSharp) Method

ToString() public method

public ToString ( ) : string
return string
        public override string ToString()
        {
            return Name;
        }

Usage Example

        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
        }