Browse Source

Made validation enable-able during binding construction, similar to WPF. Now validation events are only raised when the validation type is enabled on the property.

pull/514/head
Jeremy Koritzinsky 10 years ago
parent
commit
774c6e6fa4
  1. 4
      src/Markup/Perspex.Markup.Xaml/Data/Binding.cs
  2. 2
      src/Markup/Perspex.Markup.Xaml/MarkupExtensions/BindingExtension.cs
  3. 5
      src/Markup/Perspex.Markup/Data/Plugins/ExceptionValidationCheckerPlugin.cs
  4. 5
      src/Markup/Perspex.Markup/Data/Plugins/IndeiValidationCheckerPlugin.cs
  5. 4
      src/Perspex.Base/Data/BindingOperations.cs
  6. 21
      src/Perspex.Base/Data/InstancedBinding.cs
  7. 13
      src/Perspex.Base/Data/ValidationMethods.cs
  8. 7
      src/Perspex.Base/Data/ValidationStatus.cs
  9. 8
      src/Perspex.Base/IPerspexObject.cs
  10. 1
      src/Perspex.Base/Perspex.Base.csproj
  11. 17
      src/Perspex.Base/PerspexObject.cs
  12. 10
      src/Perspex.Base/PriorityBindingEntry.cs
  13. 5
      src/Perspex.Base/PriorityLevel.cs
  14. 5
      src/Perspex.Base/PriorityValue.cs
  15. 6
      tests/Perspex.Markup.Xaml.UnitTests/Data/BindingTests_TemplatedParent.cs
  16. 112
      tests/Perspex.Markup.Xaml.UnitTests/Data/BindingTests_Validation.cs
  17. 1
      tests/Perspex.Markup.Xaml.UnitTests/Perspex.Markup.Xaml.UnitTests.csproj
  18. 4
      tests/Perspex.Styling.UnitTests/SelectorTests_Child.cs
  19. 4
      tests/Perspex.Styling.UnitTests/SelectorTests_Descendent.cs
  20. 4
      tests/Perspex.Styling.UnitTests/TestControlBase.cs
  21. 4
      tests/Perspex.Styling.UnitTests/TestTemplatedControl.cs

4
src/Markup/Perspex.Markup.Xaml/Data/Binding.cs

@ -77,6 +77,8 @@ namespace Perspex.Markup.Xaml.Data
/// </summary> /// </summary>
public object Source { get; set; } public object Source { get; set; }
public ValidationMethods ValidationMethods { get; set; }
/// <inheritdoc/> /// <inheritdoc/>
public InstancedBinding Initiate( public InstancedBinding Initiate(
IPerspexObject target, IPerspexObject target,
@ -126,7 +128,7 @@ namespace Perspex.Markup.Xaml.Data
FallbackValue, FallbackValue,
Priority); Priority);
return new InstancedBinding(subject, Mode, Priority); return new InstancedBinding(subject, Mode, Priority, ValidationMethods);
} }
private static PathInfo ParsePath(string path) private static PathInfo ParsePath(string path)

2
src/Markup/Perspex.Markup.Xaml/MarkupExtensions/BindingExtension.cs

@ -29,6 +29,7 @@ namespace Perspex.Markup.Xaml.MarkupExtensions
Mode = Mode, Mode = Mode,
Path = Path, Path = Path,
Priority = Priority, Priority = Priority,
ValidationMethods = ValidationMethods
}; };
} }
@ -40,5 +41,6 @@ namespace Perspex.Markup.Xaml.MarkupExtensions
public string Path { get; set; } public string Path { get; set; }
public BindingPriority Priority { get; set; } = BindingPriority.LocalValue; public BindingPriority Priority { get; set; } = BindingPriority.LocalValue;
public object Source { get; set; } public object Source { get; set; }
public ValidationMethods ValidationMethods { get; set; } = ValidationMethods.None;
} }
} }

5
src/Markup/Perspex.Markup/Data/Plugins/ExceptionValidationCheckerPlugin.cs

@ -64,6 +64,11 @@ namespace Perspex.Markup.Data.Plugins
/// <inheritdoc/> /// <inheritdoc/>
public override bool IsValid => Exception == null; public override bool IsValid => Exception == null;
public override bool Match(ValidationMethods enabledMethods)
{
return (enabledMethods & ValidationMethods.Exceptions) != 0;
}
} }
} }
} }

5
src/Markup/Perspex.Markup/Data/Plugins/IndeiValidationCheckerPlugin.cs

@ -86,6 +86,11 @@ namespace Perspex.Markup.Data.Plugins
/// The errors on the given property and on the object as a whole. /// The errors on the given property and on the object as a whole.
/// </summary> /// </summary>
public IEnumerable Errors { get; } public IEnumerable Errors { get; }
public override bool Match(ValidationMethods enabledMethods)
{
return (enabledMethods & ValidationMethods.INotifyDataErrorInfo) != 0;
}
} }
} }
} }

4
src/Perspex.Base/Data/BindingOperations.cs

@ -44,10 +44,10 @@ namespace Perspex.Data
{ {
case BindingMode.Default: case BindingMode.Default:
case BindingMode.OneWay: case BindingMode.OneWay:
return target.Bind(property, binding.Observable ?? binding.Subject, binding.Priority); return target.Bind(property, binding.Observable ?? binding.Subject, binding.Priority, binding.ValidationMethods);
case BindingMode.TwoWay: case BindingMode.TwoWay:
return new CompositeDisposable( return new CompositeDisposable(
target.Bind(property, binding.Subject, binding.Priority), target.Bind(property, binding.Subject, binding.Priority, binding.ValidationMethods),
target.GetObservable(property).Subscribe(binding.Subject)); target.GetObservable(property).Subscribe(binding.Subject));
case BindingMode.OneTime: case BindingMode.OneTime:
var source = binding.Subject ?? binding.Observable; var source = binding.Subject ?? binding.Observable;

21
src/Perspex.Base/Data/InstancedBinding.cs

@ -29,12 +29,16 @@ namespace Perspex.Data
/// <param name="value"> /// <param name="value">
/// The value used for the <see cref="BindingMode.OneTime"/> binding. /// The value used for the <see cref="BindingMode.OneTime"/> binding.
/// </param> /// </param>
/// <param name="methods">The validation methods for this binding.</param>
/// <param name="priority">The binding priority.</param> /// <param name="priority">The binding priority.</param>
public InstancedBinding(object value, BindingPriority priority = BindingPriority.LocalValue) public InstancedBinding(object value,
BindingPriority priority = BindingPriority.LocalValue,
ValidationMethods methods = ValidationMethods.None)
{ {
Mode = BindingMode.OneTime; Mode = BindingMode.OneTime;
Priority = priority; Priority = priority;
Value = value; Value = value;
ValidationMethods = methods;
} }
/// <summary> /// <summary>
@ -43,10 +47,12 @@ namespace Perspex.Data
/// <param name="observable">The observable for a one-way binding.</param> /// <param name="observable">The observable for a one-way binding.</param>
/// <param name="mode">The binding mode.</param> /// <param name="mode">The binding mode.</param>
/// <param name="priority">The binding priority.</param> /// <param name="priority">The binding priority.</param>
/// <param name="methods">The validation methods for this binding.</param>
public InstancedBinding( public InstancedBinding(
IObservable<object> observable, IObservable<object> observable,
BindingMode mode = BindingMode.OneWay, BindingMode mode = BindingMode.OneWay,
BindingPriority priority = BindingPriority.LocalValue) BindingPriority priority = BindingPriority.LocalValue,
ValidationMethods methods = ValidationMethods.None)
{ {
Contract.Requires<ArgumentNullException>(observable != null); Contract.Requires<ArgumentNullException>(observable != null);
@ -60,6 +66,7 @@ namespace Perspex.Data
Mode = mode; Mode = mode;
Priority = priority; Priority = priority;
Observable = observable; Observable = observable;
ValidationMethods = methods;
} }
/// <summary> /// <summary>
@ -68,16 +75,19 @@ namespace Perspex.Data
/// <param name="subject">The subject for a two-way binding.</param> /// <param name="subject">The subject for a two-way binding.</param>
/// <param name="mode">The binding mode.</param> /// <param name="mode">The binding mode.</param>
/// <param name="priority">The binding priority.</param> /// <param name="priority">The binding priority.</param>
/// <param name="methods">The validation methods for this binding.</param>
public InstancedBinding( public InstancedBinding(
ISubject<object> subject, ISubject<object> subject,
BindingMode mode = BindingMode.OneWay, BindingMode mode = BindingMode.OneWay,
BindingPriority priority = BindingPriority.LocalValue) BindingPriority priority = BindingPriority.LocalValue,
ValidationMethods methods = ValidationMethods.None)
{ {
Contract.Requires<ArgumentNullException>(subject != null); Contract.Requires<ArgumentNullException>(subject != null);
Mode = mode; Mode = mode;
Priority = priority; Priority = priority;
Subject = subject; Subject = subject;
ValidationMethods = methods;
} }
/// <summary> /// <summary>
@ -104,5 +114,10 @@ namespace Perspex.Data
/// Gets the subject for a two-way binding. /// Gets the subject for a two-way binding.
/// </summary> /// </summary>
public ISubject<object> Subject { get; } public ISubject<object> Subject { get; }
/// <summary>
/// Gets the validation methods for this binding.
/// </summary>
public ValidationMethods ValidationMethods { get; }
} }
} }

13
src/Perspex.Base/Data/ValidationMethods.cs

@ -0,0 +1,13 @@
using System;
namespace Perspex.Data
{
[Flags]
public enum ValidationMethods
{
None = 0,
Exceptions = 1,
INotifyDataErrorInfo = 2,
All = -1
}
}

7
src/Perspex.Base/Data/ValidationStatus.cs

@ -19,5 +19,12 @@ namespace Perspex.Data
/// True when the data passes validation; otherwise, false. /// True when the data passes validation; otherwise, false.
/// </summary> /// </summary>
public abstract bool IsValid { get; } public abstract bool IsValid { get; }
/// <summary>
/// Checks if this validation status came from a currently enabled method of validation checking.
/// </summary>
/// <param name="enabledMethods">The enabled methods of validation checking.</param>
/// <returns>True if enabled; otherwise, false.</returns>
public abstract bool Match(ValidationMethods enabledMethods);
} }
} }

8
src/Perspex.Base/IPerspexObject.cs

@ -67,13 +67,15 @@ namespace Perspex
/// <param name="property">The property.</param> /// <param name="property">The property.</param>
/// <param name="source">The observable.</param> /// <param name="source">The observable.</param>
/// <param name="priority">The priority of the binding.</param> /// <param name="priority">The priority of the binding.</param>
/// <param name="validation">The validation methods of the binding.</param>
/// <returns> /// <returns>
/// A disposable which can be used to terminate the binding. /// A disposable which can be used to terminate the binding.
/// </returns> /// </returns>
IDisposable Bind( IDisposable Bind(
PerspexProperty property, PerspexProperty property,
IObservable<object> source, IObservable<object> source,
BindingPriority priority = BindingPriority.LocalValue); BindingPriority priority = BindingPriority.LocalValue,
ValidationMethods validation = ValidationMethods.None);
/// <summary> /// <summary>
/// Binds a <see cref="PerspexProperty"/> to an observable. /// Binds a <see cref="PerspexProperty"/> to an observable.
@ -82,12 +84,14 @@ namespace Perspex
/// <param name="property">The property.</param> /// <param name="property">The property.</param>
/// <param name="source">The observable.</param> /// <param name="source">The observable.</param>
/// <param name="priority">The priority of the binding.</param> /// <param name="priority">The priority of the binding.</param>
/// <param name="validation">The validation methods of the binding.</param>
/// <returns> /// <returns>
/// A disposable which can be used to terminate the binding. /// A disposable which can be used to terminate the binding.
/// </returns> /// </returns>
IDisposable Bind<T>( IDisposable Bind<T>(
PerspexProperty<T> property, PerspexProperty<T> property,
IObservable<T> source, IObservable<T> source,
BindingPriority priority = BindingPriority.LocalValue); BindingPriority priority = BindingPriority.LocalValue,
ValidationMethods validation = ValidationMethods.None);
} }
} }

1
src/Perspex.Base/Perspex.Base.csproj

@ -44,6 +44,7 @@
<Link>Properties\SharedAssemblyInfo.cs</Link> <Link>Properties\SharedAssemblyInfo.cs</Link>
</Compile> </Compile>
<Compile Include="Data\BindingError.cs" /> <Compile Include="Data\BindingError.cs" />
<Compile Include="Data\ValidationMethods.cs" />
<Compile Include="Data\ValidationStatus.cs" /> <Compile Include="Data\ValidationStatus.cs" />
<Compile Include="Diagnostics\INotifyCollectionChangedDebug.cs" /> <Compile Include="Diagnostics\INotifyCollectionChangedDebug.cs" />
<Compile Include="Data\AssignBindingAttribute.cs" /> <Compile Include="Data\AssignBindingAttribute.cs" />

17
src/Perspex.Base/PerspexObject.cs

@ -375,13 +375,15 @@ namespace Perspex
/// <param name="property">The property.</param> /// <param name="property">The property.</param>
/// <param name="source">The observable.</param> /// <param name="source">The observable.</param>
/// <param name="priority">The priority of the binding.</param> /// <param name="priority">The priority of the binding.</param>
/// <param name="validation">The validation methods of the binding.</param>
/// <returns> /// <returns>
/// A disposable which can be used to terminate the binding. /// A disposable which can be used to terminate the binding.
/// </returns> /// </returns>
public IDisposable Bind( public IDisposable Bind(
PerspexProperty property, PerspexProperty property,
IObservable<object> source, IObservable<object> source,
BindingPriority priority = BindingPriority.LocalValue) BindingPriority priority = BindingPriority.LocalValue,
ValidationMethods validation = ValidationMethods.None)
{ {
Contract.Requires<ArgumentNullException>(property != null); Contract.Requires<ArgumentNullException>(property != null);
VerifyAccess(); VerifyAccess();
@ -408,15 +410,16 @@ namespace Perspex
.Select(x => CastOrDefault(x, property.PropertyType)) .Select(x => CastOrDefault(x, property.PropertyType))
.Do(_ => { }, () => s_directBindings.Remove(subscription)) .Do(_ => { }, () => s_directBindings.Remove(subscription))
.Subscribe(x => DirectBindingSet(property, x)); .Subscribe(x => DirectBindingSet(property, x));
validationSubcription = source.OfType<ValidationStatus>().Subscribe(x => ValidationChanged(property, x)); validationSubcription = source
.OfType<ValidationStatus>()
.Where(v => v.Match(validation))
.Subscribe(x => ValidationChanged(property, x));
s_directBindings.Add(subscription); s_directBindings.Add(subscription);
s_directBindings.Add(validationSubcription);
return Disposable.Create(() => return Disposable.Create(() =>
{ {
validationSubcription.Dispose(); validationSubcription.Dispose();
s_directBindings.Remove(validationSubcription);
subscription.Dispose(); subscription.Dispose();
s_directBindings.Remove(subscription); s_directBindings.Remove(subscription);
}); });
@ -444,7 +447,7 @@ namespace Perspex
GetDescription(source), GetDescription(source),
priority); priority);
return v.Add(source, (int)priority); return v.Add(source, (int)priority, validation);
} }
} }
@ -455,13 +458,15 @@ namespace Perspex
/// <param name="property">The property.</param> /// <param name="property">The property.</param>
/// <param name="source">The observable.</param> /// <param name="source">The observable.</param>
/// <param name="priority">The priority of the binding.</param> /// <param name="priority">The priority of the binding.</param>
/// <param name="validation">The validation methods of the binding.</param>
/// <returns> /// <returns>
/// A disposable which can be used to terminate the binding. /// A disposable which can be used to terminate the binding.
/// </returns> /// </returns>
public IDisposable Bind<T>( public IDisposable Bind<T>(
PerspexProperty<T> property, PerspexProperty<T> property,
IObservable<T> source, IObservable<T> source,
BindingPriority priority = BindingPriority.LocalValue) BindingPriority priority = BindingPriority.LocalValue,
ValidationMethods validation = ValidationMethods.None)
{ {
Contract.Requires<ArgumentNullException>(property != null); Contract.Requires<ArgumentNullException>(property != null);

10
src/Perspex.Base/PriorityBindingEntry.cs

@ -13,6 +13,7 @@ namespace Perspex
{ {
private PriorityLevel _owner; private PriorityLevel _owner;
private IDisposable _subscription; private IDisposable _subscription;
private ValidationMethods _validation;
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="PriorityBindingEntry"/> class. /// Initializes a new instance of the <see cref="PriorityBindingEntry"/> class.
@ -21,10 +22,12 @@ namespace Perspex
/// <param name="index"> /// <param name="index">
/// The binding index. Later bindings should have higher indexes. /// The binding index. Later bindings should have higher indexes.
/// </param> /// </param>
public PriorityBindingEntry(PriorityLevel owner, int index) /// <param name="validation">The validation settings for the binding.</param>
public PriorityBindingEntry(PriorityLevel owner, int index, ValidationMethods validation)
{ {
_owner = owner; _owner = owner;
Index = index; Index = index;
_validation = validation;
} }
/// <summary> /// <summary>
@ -103,7 +106,10 @@ namespace Perspex
if (validationStatus != null) if (validationStatus != null)
{ {
_owner.Validation(this, validationStatus); if (validationStatus.Match(_validation))
{
_owner.Validation(this, validationStatus);
}
} }
else if (bindingError == null || bindingError.UseFallbackValue) else if (bindingError == null || bindingError.UseFallbackValue)
{ {

5
src/Perspex.Base/PriorityLevel.cs

@ -97,12 +97,13 @@ namespace Perspex
/// Adds a binding. /// Adds a binding.
/// </summary> /// </summary>
/// <param name="binding">The binding to add.</param> /// <param name="binding">The binding to add.</param>
/// <param name="validation">Validation settings for the binding.</param>
/// <returns>A disposable used to remove the binding.</returns> /// <returns>A disposable used to remove the binding.</returns>
public IDisposable Add(IObservable<object> binding) public IDisposable Add(IObservable<object> binding, ValidationMethods validation)
{ {
Contract.Requires<ArgumentNullException>(binding != null); Contract.Requires<ArgumentNullException>(binding != null);
var entry = new PriorityBindingEntry(this, _nextIndex++); var entry = new PriorityBindingEntry(this, _nextIndex++, validation);
var node = Bindings.AddFirst(entry); var node = Bindings.AddFirst(entry);
entry.Start(binding); entry.Start(binding);

5
src/Perspex.Base/PriorityValue.cs

@ -77,12 +77,13 @@ namespace Perspex
/// </summary> /// </summary>
/// <param name="binding">The binding.</param> /// <param name="binding">The binding.</param>
/// <param name="priority">The binding priority.</param> /// <param name="priority">The binding priority.</param>
/// <param name="validation">Validation settings for the binding.</param>
/// <returns> /// <returns>
/// A disposable that will remove the binding. /// A disposable that will remove the binding.
/// </returns> /// </returns>
public IDisposable Add(IObservable<object> binding, int priority) public IDisposable Add(IObservable<object> binding, int priority, ValidationMethods validation = ValidationMethods.None)
{ {
return GetLevel(priority).Add(binding); return GetLevel(priority).Add(binding, validation);
} }
/// <summary> /// <summary>

6
tests/Perspex.Markup.Xaml.UnitTests/Data/BindingTests_TemplatedParent.cs

@ -32,7 +32,8 @@ namespace Perspex.Markup.Xaml.UnitTests.Data
target.Verify(x => x.Bind( target.Verify(x => x.Bind(
TextBox.TextProperty, TextBox.TextProperty,
It.IsAny<IObservable<object>>(), It.IsAny<IObservable<object>>(),
BindingPriority.TemplatedParent)); BindingPriority.TemplatedParent,
ValidationMethods.None));
} }
[Fact] [Fact]
@ -52,7 +53,8 @@ namespace Perspex.Markup.Xaml.UnitTests.Data
target.Verify(x => x.Bind( target.Verify(x => x.Bind(
TextBox.TextProperty, TextBox.TextProperty,
It.IsAny<ISubject<object>>(), It.IsAny<ISubject<object>>(),
BindingPriority.TemplatedParent)); BindingPriority.TemplatedParent,
ValidationMethods.None));
} }
private Mock<IControl> CreateTarget( private Mock<IControl> CreateTarget(

112
tests/Perspex.Markup.Xaml.UnitTests/Data/BindingTests_Validation.cs

@ -0,0 +1,112 @@
using Perspex.Controls;
using Perspex.Markup.Xaml.Data;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using Xunit;
namespace Perspex.Markup.Xaml.UnitTests.Data
{
public class BindingTests_Validation
{
public class Data : INotifyPropertyChanged
{
private string mustbeNonEmpty;
public string MustBeNonEmpty
{
get { return mustbeNonEmpty; }
set
{
if (string.IsNullOrEmpty(value))
{
throw new ArgumentException(nameof(value));
}
mustbeNonEmpty = value;
}
}
public event PropertyChangedEventHandler PropertyChanged;
private void NotifyPropertyChanged([CallerMemberName] string propertyName = "")
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
[Fact]
public void Disabled_Validation_Should_Not_Trigger_Validation_Change_Direct()
{
var source = new Data { MustBeNonEmpty = "Test" };
var target = new TextBlock { DataContext = source };
var binding = new Binding
{
Path = nameof(source.MustBeNonEmpty),
Mode = Perspex.Data.BindingMode.TwoWay,
ValidationMethods = Perspex.Data.ValidationMethods.None
};
target.Bind(TextBlock.TextProperty, binding);
target.Text = "";
Assert.Null(target.ValidationStatus);
}
[Fact]
public void Enabled_Validation_Should_Trigger_Validation_Change_Direct()
{
var source = new Data { MustBeNonEmpty = "Test" };
var target = new TextBlock { DataContext = source };
var binding = new Binding
{
Path = nameof(source.MustBeNonEmpty),
Mode = Perspex.Data.BindingMode.TwoWay,
ValidationMethods = Perspex.Data.ValidationMethods.All
};
target.Bind(TextBlock.TextProperty, binding);
target.Text = "";
Assert.NotNull(target.ValidationStatus);
}
[Fact]
public void Disabled_Validation_Should_Not_Trigger_Validation_Change_Styled()
{
var source = new Data { MustBeNonEmpty = "Test" };
var target = new TextBlock { DataContext = source };
var binding = new Binding
{
Path = nameof(source.MustBeNonEmpty),
Mode = Perspex.Data.BindingMode.TwoWay,
ValidationMethods = Perspex.Data.ValidationMethods.None
};
target.Bind(Control.TagProperty, binding);
target.Tag = "";
Assert.Null(target.ValidationStatus);
}
[Fact]
public void Enabled_Validation_Should_Trigger_Validation_Change_Styled()
{
var source = new Data { MustBeNonEmpty = "Test" };
var target = new TextBlock { DataContext = source };
var binding = new Binding
{
Path = nameof(source.MustBeNonEmpty),
Mode = Perspex.Data.BindingMode.TwoWay,
ValidationMethods = Perspex.Data.ValidationMethods.All
};
target.Bind(Control.TagProperty, binding);
target.Tag = "";
Assert.NotNull(target.ValidationStatus);
}
}
}

1
tests/Perspex.Markup.Xaml.UnitTests/Perspex.Markup.Xaml.UnitTests.csproj

@ -94,6 +94,7 @@
<ItemGroup> <ItemGroup>
<Compile Include="Data\BindingTests_Source.cs" /> <Compile Include="Data\BindingTests_Source.cs" />
<Compile Include="Data\BindingTests_ElementName.cs" /> <Compile Include="Data\BindingTests_ElementName.cs" />
<Compile Include="Data\BindingTests_Validation.cs" />
<Compile Include="Data\MultiBindingTests.cs" /> <Compile Include="Data\MultiBindingTests.cs" />
<Compile Include="Data\BindingTests_TemplatedParent.cs" /> <Compile Include="Data\BindingTests_TemplatedParent.cs" />
<Compile Include="Data\BindingTests.cs" /> <Compile Include="Data\BindingTests.cs" />

4
tests/Perspex.Styling.UnitTests/SelectorTests_Child.cs

@ -129,7 +129,7 @@ namespace Perspex.Styling.UnitTests
throw new NotImplementedException(); throw new NotImplementedException();
} }
public IDisposable Bind(PerspexProperty property, IObservable<object> source, BindingPriority priority) public IDisposable Bind(PerspexProperty property, IObservable<object> source, BindingPriority priority, ValidationMethods validation)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
@ -139,7 +139,7 @@ namespace Perspex.Styling.UnitTests
throw new NotImplementedException(); throw new NotImplementedException();
} }
public IDisposable Bind<T>(PerspexProperty<T> property, IObservable<T> source, BindingPriority priority = BindingPriority.LocalValue) public IDisposable Bind<T>(PerspexProperty<T> property, IObservable<T> source, BindingPriority priority = BindingPriority.LocalValue, ValidationMethods validation = ValidationMethods.None)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }

4
tests/Perspex.Styling.UnitTests/SelectorTests_Descendent.cs

@ -160,7 +160,7 @@ namespace Perspex.Styling.UnitTests
throw new NotImplementedException(); throw new NotImplementedException();
} }
public IDisposable Bind(PerspexProperty property, IObservable<object> source, BindingPriority priority) public IDisposable Bind(PerspexProperty property, IObservable<object> source, BindingPriority priority = BindingPriority.LocalValue, ValidationMethods validation = ValidationMethods.None)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
@ -170,7 +170,7 @@ namespace Perspex.Styling.UnitTests
throw new NotImplementedException(); throw new NotImplementedException();
} }
public IDisposable Bind<T>(PerspexProperty<T> property, IObservable<T> source, BindingPriority priority = BindingPriority.LocalValue) public IDisposable Bind<T>(PerspexProperty<T> property, IObservable<T> source, BindingPriority priority = BindingPriority.LocalValue, ValidationMethods validation = ValidationMethods.None)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }

4
tests/Perspex.Styling.UnitTests/TestControlBase.cs

@ -62,12 +62,12 @@ namespace Perspex.Styling.UnitTests
throw new NotImplementedException(); throw new NotImplementedException();
} }
public IDisposable Bind(PerspexProperty property, IObservable<object> source, BindingPriority priority) public IDisposable Bind(PerspexProperty property, IObservable<object> source, BindingPriority priority = BindingPriority.LocalValue, ValidationMethods validation = ValidationMethods.None)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public IDisposable Bind<T>(PerspexProperty<T> property, IObservable<T> source, BindingPriority priority = BindingPriority.LocalValue) public IDisposable Bind<T>(PerspexProperty<T> property, IObservable<T> source, BindingPriority priority = BindingPriority.LocalValue, ValidationMethods validation = ValidationMethods.None)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }

4
tests/Perspex.Styling.UnitTests/TestTemplatedControl.cs

@ -57,12 +57,12 @@ namespace Perspex.Styling.UnitTests
throw new NotImplementedException(); throw new NotImplementedException();
} }
public IDisposable Bind(PerspexProperty property, IObservable<object> source, BindingPriority priority) public IDisposable Bind(PerspexProperty property, IObservable<object> source, BindingPriority priority = BindingPriority.LocalValue, ValidationMethods validation = ValidationMethods.None)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public IDisposable Bind<T>(PerspexProperty<T> property, IObservable<T> source, BindingPriority priority = BindingPriority.LocalValue) public IDisposable Bind<T>(PerspexProperty<T> property, IObservable<T> source, BindingPriority priority = BindingPriority.LocalValue, ValidationMethods validation = ValidationMethods.None)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }

Loading…
Cancel
Save