diff --git a/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Data/Given_BindingExpression.cs b/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Data/Given_BindingExpression.cs index 9b5433140a20..c6633f1d49af 100644 --- a/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Data/Given_BindingExpression.cs +++ b/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Data/Given_BindingExpression.cs @@ -1,5 +1,6 @@ using System.Threading.Tasks; using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Data; using Microsoft.UI.Xaml.Media; using Private.Infrastructure; using Uno.Disposables; @@ -8,6 +9,15 @@ namespace Uno.UI.RuntimeTests.Tests.Windows_UI_Xaml_Data; [TestClass] public class Given_BindingExpression { + [TestMethod] + [RunsOnUIThread] + public async Task When_Binding_Should_Have_Correct_Default() + { + var binding = new Binding(); + Assert.AreEqual(BindingMode.OneWay, binding.Mode); + Assert.AreEqual("", binding.ConverterLanguage); + } + [TestMethod] [RunsOnUIThread] public async Task When_Binding_Outer_Inner_DC_Null() diff --git a/src/Uno.UI/UI/Xaml/Data/Binding.cs b/src/Uno.UI/UI/Xaml/Data/Binding.cs index de571bf908bb..81a0550f1887 100644 --- a/src/Uno.UI/UI/Xaml/Data/Binding.cs +++ b/src/Uno.UI/UI/Xaml/Data/Binding.cs @@ -52,7 +52,6 @@ public partial class Binding : BindingBase public Binding() { - } /// @@ -68,7 +67,6 @@ public Binding() Path = path ?? new PropertyPath(String.Empty); Converter = converter; ConverterParameter = converterParameter; - Mode = BindingMode.OneWay; } public static implicit operator Binding(string path) @@ -98,7 +96,7 @@ public static implicit operator Binding(string path) /// Gets or sets a value that names the language to pass to any converter specified by the Converter property. /// /// The converter language. - public string ConverterLanguage { get; set; } + public string ConverterLanguage { get; set; } = ""; /// /// Gets or sets the name of the element to use as the binding source for the Binding. @@ -129,7 +127,7 @@ public object FallbackValue /// Gets or sets a value that indicates the direction of the data flow in the binding. /// /// The mode. - public BindingMode Mode { get; set; } + public BindingMode Mode { get; set; } = BindingMode.OneWay; /// /// Gets or sets the binding source by specifying its location relative to the position of the binding target. This is most often used in bindings within XAML control templates.