Author: miguel
Date: 2007-06-09 19:32:40 -0400 (Sat, 09 Jun 2007)
New Revision: 79087
Modified:
trunk/olive/class/agclr/System.Windows/ChangeLog
trunk/olive/class/agclr/System.Windows/DependencyObject.cs
Log:
2007-06-09 Miguel de Icaza <[EMAIL PROTECTED]>
* DependencyObject.cs (SetValue): Also consider class hierarchy,
so a SolidBrush can be assigned to a Brush.
Modified: trunk/olive/class/agclr/System.Windows/ChangeLog
===================================================================
--- trunk/olive/class/agclr/System.Windows/ChangeLog 2007-06-09 23:26:23 UTC
(rev 79086)
+++ trunk/olive/class/agclr/System.Windows/ChangeLog 2007-06-09 23:32:40 UTC
(rev 79087)
@@ -1,3 +1,8 @@
+2007-06-09 Miguel de Icaza <[EMAIL PROTECTED]>
+
+ * DependencyObject.cs (SetValue): Also consider class hierarchy,
+ so a SolidBrush can be assigned to a Brush.
+
2007-06-08 Miguel de Icaza <[EMAIL PROTECTED]>
* DependencyObject.cs (GetAsValue): Helper.
Modified: trunk/olive/class/agclr/System.Windows/DependencyObject.cs
===================================================================
--- trunk/olive/class/agclr/System.Windows/DependencyObject.cs 2007-06-09
23:26:23 UTC (rev 79086)
+++ trunk/olive/class/agclr/System.Windows/DependencyObject.cs 2007-06-09
23:32:40 UTC (rev 79087)
@@ -299,9 +299,10 @@
NativeMethods.dependency_object_set_value
(native, property.native, IntPtr.Zero);
return;
}
-
+
+ Type t = obj.GetType ();
Value v;
- if (obj.GetType () == property.type)
+ if (t == property.type ||
property.type.IsAssignableFrom (t))
v = GetAsValue (obj);
else
v = GetAsValue (Convert.ChangeType (obj,
property.type));
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches