Permalink
Browse files

Validation framework rebuilt on top of INotifyDataErrorInfo.

TODO: Add hooks for ValidationAttribute on supported platforms.
TODO: Tests
  • Loading branch information...
1 parent c095e49 commit 1a02145556d01ede2697ff2001d87ac57b343240 @jlaanstra jlaanstra committed Mar 25, 2013
@@ -6,7 +6,7 @@
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:routing="clr-namespace:ReactiveUI.Routing;assembly=ReactiveUI.Routing_WP8"
+ xmlns:routing="clr-namespace:ReactiveUI.Routing;assembly=ReactiveUI.Xaml_WP8"
mc:Ignorable="d"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
@@ -53,19 +53,19 @@ public void IsObjectValidTest()
var fixture = new ValidatedTestFixture();
//fixture.IsValidObservable.Subscribe(output.Add);
- Assert.False(fixture.IsObjectValid());
+ Assert.True(fixture.HasErrors);
fixture.IsNotNullString = "foo";
- Assert.False(fixture.IsObjectValid());
+ Assert.True(fixture.HasErrors);
fixture.IsOnlyOneWord = "Foo Bar";
- Assert.False(fixture.IsObjectValid());
+ Assert.True(fixture.HasErrors);
fixture.IsOnlyOneWord = "Foo";
- Assert.True(fixture.IsObjectValid());
+ Assert.False(fixture.HasErrors);
fixture.IsOnlyOneWord = "";
- Assert.False(fixture.IsObjectValid());
+ Assert.True(fixture.HasErrors);
/*
new[] { false, false, false, true, false }.Zip(output, (expected, actual) => new { expected, actual })
@@ -81,7 +81,7 @@ public void IgnoresStaticPropertiesTest()
Assert.DoesNotThrow(delegate
{
- var error = fixture["NonStaticProperty"];
+ var error = fixture.GetErrors("NonStaticProperty");
});
}
}
@@ -5,6 +5,7 @@
using System.Linq;
using System.Text;
using System.Windows;
+using ReactiveUI.Routing;
#if WINRT
using Windows.ApplicationModel;
View
@@ -523,15 +523,6 @@ public class ViewContractAttribute : Attribute
/// </summary>
public string Contract { get; set; }
}
-
- public static class ObservableUtils
- {
- public static IConnectableObservable<T> PermaRef<T>(this IConnectableObservable<T> This)
- {
- This.Connect();
- return This;
- }
- }
}
// vim: tw=120 ts=4 sw=4 et :
Oops, something went wrong.

0 comments on commit 1a02145

Please sign in to comment.