2008-09-02 Carlos Alberto Cortez <calberto.cortez@gmail.com>
authorCarlos Alberto Cortez <calberto.cortez@gmail.com>
Tue, 2 Sep 2008 18:20:49 +0000 (18:20 -0000)
committerCarlos Alberto Cortez <calberto.cortez@gmail.com>
Tue, 2 Sep 2008 18:20:49 +0000 (18:20 -0000)
* Binding.cs: When connecting the event handler for the "Changed"
event for the property, only do it for PropertyManager, and not for
CurrencyManager - this is exactly what does .Net, totally ignoring any
change in the property of the elements of a list.
Fixes the tests.

svn path=/trunk/mcs/; revision=112112

mcs/class/Managed.Windows.Forms/System.Windows.Forms/Binding.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog

index ea7d4da2542fa383e0fcabe0a0fd8accd906c9ee..2c703f7f3ea202a0f2d7f3d25ddfa44624fa3772 100644 (file)
@@ -342,9 +342,11 @@ namespace System.Windows.Forms {
                                manager.AddBinding (this);
                                manager.PositionChanged += new EventHandler (PositionChangedHandler);
 
-                               EventDescriptor prop_changed_event = GetPropertyChangedEvent (manager.Current, binding_member_info.BindingField);
-                               if (prop_changed_event != null)
-                                       prop_changed_event.AddEventHandler (manager.Current, new EventHandler (SourcePropertyChangedHandler));
+                               if (manager is PropertyManager) { // Match .net, which only watchs simple objects
+                                       EventDescriptor prop_changed_event = GetPropertyChangedEvent (manager.Current, binding_member_info.BindingField);
+                                       if (prop_changed_event != null)
+                                               prop_changed_event.AddEventHandler (manager.Current, new EventHandler (SourcePropertyChangedHandler));
+                               }
                        }
 
                        if (manager.Position == -1)
index 4264f15b7957f0216a72639aeaafd27407c9c655..5b67271d56fe13ec76b5f6a331f1bfc7ee4b714a 100644 (file)
@@ -1,3 +1,11 @@
+2008-09-02  Carlos Alberto Cortez <calberto.cortez@gmail.com>
+
+       * Binding.cs: When connecting the event handler for the "Changed"
+       event for the property, only do it for PropertyManager, and not for
+       CurrencyManager - this is exactly what does .Net, totally ignoring any
+       change in the property of the elements of a list.
+       Fixes the tests.
+
 2008-09-02  Jonathan Pobst  <monkey@jpobst.com>
 
        * XplatUIWin32.cs: Ensure we never send the WS_EX_MDICHILD flag