Make ToolbarItem constructor match properties (#4333)
authorEdward Brey <edward@breyfamily.net>
Wed, 7 Nov 2018 13:12:24 +0000 (07:12 -0600)
committerStephane Delcroix <stephane@delcroix.org>
Wed, 7 Nov 2018 13:12:24 +0000 (14:12 +0100)
This changes the `ToolbarItem` constructor's `name` parameter to `text`, to match the non-obsolete `Text` that gets the value. Without the change, it's confusing when tracing data flow related to `Text`, since it doesn't appear at first that it's being set.

Xamarin.Forms.Core/ToolbarItem.cs

index 41cf144..54f2812 100644 (file)
@@ -16,12 +16,12 @@ namespace Xamarin.Forms
                {
                }
 
-               public ToolbarItem(string name, string icon, Action activated, ToolbarItemOrder order = ToolbarItemOrder.Default, int priority = 0)
+               public ToolbarItem(string text, string icon, Action activated, ToolbarItemOrder order = ToolbarItemOrder.Default, int priority = 0)
                {
                        if (activated == null)
                                throw new ArgumentNullException("activated");
 
-                       Text = name;
+                       Text = text;
                        Icon = icon;
                        Clicked += (s, e) => activated();
                        Order = order;
@@ -54,4 +54,4 @@ namespace Xamarin.Forms
                        remove { Clicked -= value; }
                }
        }
-}
\ No newline at end of file
+}