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

GetDefaultValue() private method

private GetDefaultValue ( object ob ) : object
ob object
return object
        internal object GetDefaultValue(object ob)
        {
            return GetDefaultValue (Deployment.Current.Types.TypeToNativeKind (ob.GetType ()));
        }

Same methods

DependencyProperty::GetDefaultValue ( Kind kind ) : object

Usage Example

Beispiel #1
0
        static void InvokeChangedCallback(DependencyObject obj, DependencyProperty property, PropertyChangedCallback callback,
                                          object old_obj, object new_obj)
        {
            if (old_obj == null && property.property_type.IsValueType && !property.IsNullable)
            {
                old_obj = property.GetDefaultValue(obj);
                Console.WriteLine("WARNING: Got a null value for {0}.{1} which is a value type", property.DeclaringType.Name, property.Name);
            }

            if (Helper.AreEqual(property.PropertyType, old_obj, new_obj))
            {
                return;
            }

            var args = new DependencyPropertyChangedEventArgs(old_obj, new_obj, property);

            // note: since callbacks might throw exceptions but we cannot catch them
            callback(obj, args);
        }
All Usage Examples Of System.Windows.DependencyProperty::GetDefaultValue