├── .editorconfig ├── .github └── dependabot.yml ├── .gitignore ├── Gu.Wpf.ValidationScope.Demo ├── .editorconfig ├── App.xaml ├── App.xaml.cs ├── AssemblyAttributes.cs ├── ComplicatedScopeView.xaml ├── ComplicatedScopeView.xaml.cs ├── ControlTemplatesView.xaml ├── ControlTemplatesView.xaml.cs ├── Converters │ ├── BoolToBrushConverter.cs │ └── NullToVisibilityConverter.cs ├── DataGridScopeView.xaml ├── DataGridScopeView.xaml.cs ├── DataGridScopeVm.cs ├── DataTemplatesView.xaml ├── DataTemplatesView.xaml.cs ├── DynamicTypesView.xaml ├── DynamicTypesView.xaml.cs ├── Gu.Wpf.ValidationScope.Demo.csproj ├── Gu.Wpf.ValidationScope.Demo.csproj.DotSettings ├── InputTypesView.xaml ├── InputTypesView.xaml.cs ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── NotifyDataErrorInfoView.xaml ├── NotifyDataErrorInfoView.xaml.cs ├── NotifyDataErrorInfoVm.cs ├── OneLevelScopeView.xaml ├── OneLevelScopeView.xaml.cs ├── OneWayToSourceBindingsView.xaml ├── OneWayToSourceBindingsView.xaml.cs ├── OneWayToSourceBindingsViewModel.cs ├── ParentChildScopesView.xaml ├── ParentChildScopesView.xaml.cs ├── RelayCommand.cs ├── SandboxView.xaml ├── SandboxView.xaml.cs ├── SandboxVm.cs ├── ScopeIsErrorScopeView.xaml ├── ScopeIsErrorScopeView.xaml.cs ├── ScopeIsErrorScopeVm.cs ├── TwoLevelScopeView.xaml ├── TwoLevelScopeView.xaml.cs ├── UiTestWindows │ ├── ComplicatedScopeWindow.xaml │ ├── ComplicatedScopeWindow.xaml.cs │ ├── ContentTemplateSelector.cs │ ├── ControlTemplatesWindow.xaml │ ├── ControlTemplatesWindow.xaml.cs │ ├── DataGridWindow.xaml │ ├── DataGridWindow.xaml.cs │ ├── DataTemplateSelectorWindow.xaml │ ├── DataTemplateSelectorWindow.xaml.cs │ ├── DataTemplatesWindow.xaml │ ├── DataTemplatesWindow.xaml.cs │ ├── DynamicTypesWindow.xaml │ ├── DynamicTypesWindow.xaml.cs │ ├── EventTemplateSelector.cs │ ├── EventsOrderWindow.xaml │ ├── EventsOrderWindow.xaml.cs │ ├── LiveErrorsWindow.xaml │ ├── LiveErrorsWindow.xaml.cs │ ├── NotifyDataErrorInfoWindow.xaml │ ├── NotifyDataErrorInfoWindow.xaml.cs │ ├── OneLevelScopeWindow.xaml │ ├── OneLevelScopeWindow.xaml.cs │ ├── OneWayToSourceBindingsWindow.xaml │ ├── OneWayToSourceBindingsWindow.xaml.cs │ ├── ParentChildScopesWindow.xaml │ ├── ParentChildScopesWindow.xaml.cs │ ├── ScopeEvents.cs │ ├── ScopeIsErrorScopeWindow.xaml │ ├── ScopeIsErrorScopeWindow.xaml.cs │ ├── ScopeTextBoxWindow.xaml │ ├── ScopeTextBoxWindow.xaml.cs │ ├── SimpleThreeLevelScopeWindow.xaml │ ├── SimpleThreeLevelScopeWindow.xaml.cs │ ├── SimpleTwoLevelWindow.xaml │ ├── SimpleTwoLevelWindow.xaml.cs │ ├── SimpleWindow.xaml │ ├── SimpleWindow.xaml.cs │ ├── TabControlWindow.xaml │ ├── TabControlWindow.xaml.cs │ ├── TabControlWindowViewModel.cs │ ├── TwoLevelScopeWindow.xaml │ ├── TwoLevelScopeWindow.xaml.cs │ ├── ValidationEvents.cs │ ├── VisibilityWindow.xaml │ └── VisibilityWindow.xaml.cs └── ViewModel.cs ├── Gu.Wpf.ValidationScope.Tests ├── .editorconfig ├── AssemblyAttributes.cs ├── ErrorCollection │ └── ErrorCollectionTests.cs ├── Gu.Wpf.ValidationScope.Tests.csproj ├── Gu.Wpf.ValidationScope.Tests.csproj.DotSettings ├── Helpers │ ├── ErrorCollectionExt.cs │ ├── ErrorsChangedEventArgsComparer.cs │ ├── Factory.cs │ ├── GenericComparer.cs │ ├── NotifyCollectionChangedEventArgsComparer.cs │ ├── ObservableCollectionArgsComparer.cs │ ├── ObservableCollectionExt.cs │ ├── PropertyChangedEventArgsComparer.cs │ ├── ScopeEventsExt.cs │ ├── ScopeValidationErrorEventArgsComparer.cs │ ├── TestHelpers.cs │ ├── TestValidationError.cs │ └── TestValidationRule.cs └── InputTypes │ └── InputTypeCollectionConverterTests.cs ├── Gu.Wpf.ValidationScope.UiTests ├── .editorconfig ├── AssemblyAttributes.cs ├── ComplicatedScopeWindowTests.cs ├── ControlTemplatesWindowTests.cs ├── DataGridWindowTests.cs ├── DataTemplateSelectorWindowTests.cs ├── DataTemplatesWindowTests.cs ├── DynamicTypesWindowTests.cs ├── EventsOrderWindowTests.cs ├── Gu.Wpf.ValidationScope.UiTests.csproj ├── Gu.Wpf.ValidationScope.UiTests.csproj.DotSettings ├── Helpers │ ├── DumpAppDomain.cs │ └── UiElementExt.cs ├── LiveErrorsWindowTests.cs ├── NotifyDataErrorInfoWindowTests.cs ├── OneLevelScopeWindowTests.cs ├── OneWayToSourceBindingsWindowTests.cs ├── ParentChildScopesWindowTests.cs ├── ScopeIsErrorScopeWindowTests.cs ├── ScopeTextBoxWindowTests.cs ├── SimpleThreeLevelScopeWindowTests.cs ├── SimpleTwoLevelWindowTests.cs ├── SimpleWindowTests.cs ├── TabControlWindowTests.cs ├── TwoLevelScopeWindowTests.cs └── VisibilityWindowTests.cs ├── Gu.Wpf.ValidationScope.sln ├── Gu.Wpf.ValidationScope.sln.DotSettings ├── Gu.Wpf.ValidationScope.snk ├── Gu.Wpf.ValidationScope ├── .editorconfig ├── AssemblyAttributes.cs ├── ErrorCollection │ ├── ErrorCollection.cs │ ├── ErrorsChangedEventArgs.cs │ ├── ErrorsChangedEventManager.cs │ ├── INotifyErrorsChanged.cs │ └── ObservableBatchCollection.cs ├── ErrorTree │ ├── ChildCollection.cs │ ├── ErrorNode.cs │ ├── InputNode.cs │ ├── Node.cs │ ├── ScopeNode.cs │ └── ValidNode.cs ├── Gu.Wpf.ValidationScope.csproj ├── Gu.Wpf.ValidationScope.csproj.DotSettings ├── InputTypes │ ├── DefaultInputTypesExtension.cs │ ├── InputTypeCollection.cs │ ├── InputTypeCollectionConverter.cs │ ├── InputTypesExtension.cs │ ├── InputTypesExtensionCtors.generated.cs │ └── InputTypesExtensionCtors.tt ├── Internal │ ├── BindingHelper.cs │ ├── BooleanBoxes.cs │ ├── EnumerableExt.cs │ └── IsVisibleChangedEventManager.cs ├── OneWayToSourceBindings.cs ├── PublicAPI.Shipped.txt ├── PublicAPI.Unshipped.txt ├── Scope.BubbleRoute.cs ├── Scope.Events.cs ├── Scope.cs ├── ScopeValidationErrorEventArgs.cs └── stylecop.json ├── LICENSE.md ├── README.md ├── RELEASE_NOTES.md ├── Settings.XamlStyler ├── appveyor.yml └── azure-pipelines.yml /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: nuget 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ###### -- File Created With Git Source Control Provider 2015 -- ###### 2 | ###### -- From https://github.com/github/gitignore -- ###### 3 | ###### -- Warning Regenerating this file will erase all your custom ignores, unless you add them below the Custom Ignore section at the bottom -- ###### 4 | 5 | 6 | 7 | ###### -- Custom Ignore Section, Make sure all files you add to the git repo are below this line -- ###### 8 | 9 | 10 | Thumbs.db 11 | *.obj 12 | *.exe 13 | *.pdb 14 | *.user 15 | *.aps 16 | *.pch 17 | *.vspscc 18 | *_i.c 19 | *_p.c 20 | *.ncb 21 | *.suo 22 | *.sln.docstates 23 | *.tlb 24 | *.tlh 25 | *.bak 26 | *.cache 27 | *.ilk 28 | *.log 29 | [Bb]in 30 | [Dd]ebug*/ 31 | *.lib 32 | *.sbr 33 | obj/ 34 | [Rr]elease*/ 35 | _ReSharper*/ 36 | [Tt]est[Rr]esult* 37 | *.vssscc 38 | $tf*/ 39 | *.dll 40 | packages/* 41 | publish/* 42 | [Aa]rtifacts/ 43 | .vs/* 44 | /paket-files/* 45 | *.orig 46 | -------------------------------------------------------------------------------- /Gu.Wpf.ValidationScope.Demo/.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | 3 | # Default severity for analyzer diagnostics with category 'StyleCop.CSharp.DocumentationRules' 4 | dotnet_analyzer_diagnostic.category-StyleCop.CSharp.DocumentationRules.severity = none 5 | # SA0001: XML comment analysis is disabled due to project configuration 6 | dotnet_diagnostic.SA0001.severity = none 7 | 8 | # CA1062: Validate arguments of public methods 9 | dotnet_diagnostic.CA1062.severity = none 10 | 11 | # CA2109: Review visible event handlers 12 | dotnet_diagnostic.CA2109.severity = none 13 | 14 | # CA2227: Collection properties should be read only 15 | dotnet_diagnostic.CA2227.severity = none 16 | 17 | # SA1313: Parameter names should begin with lower-case letter 18 | dotnet_diagnostic.SA1313.severity = none 19 | 20 | # IDE1006: Naming Styles 21 | dotnet_diagnostic.IDE1006.severity = none 22 | -------------------------------------------------------------------------------- /Gu.Wpf.ValidationScope.Demo/App.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.ValidationScope.Demo; 2 | 3 | using System; 4 | using System.Windows; 5 | 6 | public partial class App : Application 7 | { 8 | protected override void OnStartup(StartupEventArgs e) 9 | { 10 | if (e.Args.Length == 1) 11 | { 12 | var window = e.Args[0]; 13 | this.StartupUri = new Uri($"UiTestWindows/{window}.xaml", UriKind.Relative); 14 | } 15 | 16 | base.OnStartup(e); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Gu.Wpf.ValidationScope.Demo/AssemblyAttributes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows; 3 | 4 | [assembly: CLSCompliant(false)] 5 | 6 | [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] 7 | -------------------------------------------------------------------------------- /Gu.Wpf.ValidationScope.Demo/ComplicatedScopeView.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.ValidationScope.Demo; 2 | 3 | using System.Windows.Controls; 4 | 5 | public partial class ComplicatedScopeView : UserControl 6 | { 7 | public ComplicatedScopeView() 8 | { 9 | this.InitializeComponent(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Gu.Wpf.ValidationScope.Demo/ControlTemplatesView.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 15 | 16 | 17 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 45 | 49 | 50 | 53 | 54 | 57 | 58 | 61 | 62 | 65 | 66 | 67 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /Gu.Wpf.ValidationScope.Demo/ControlTemplatesView.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.ValidationScope.Demo; 2 | 3 | using System.Windows.Controls; 4 | 5 | public partial class ControlTemplatesView : UserControl 6 | { 7 | public ControlTemplatesView() 8 | { 9 | this.InitializeComponent(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Gu.Wpf.ValidationScope.Demo/Converters/BoolToBrushConverter.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.ValidationScope.Demo; 2 | 3 | using System; 4 | using System.Globalization; 5 | using System.Windows.Data; 6 | using System.Windows.Markup; 7 | using System.Windows.Media; 8 | 9 | [MarkupExtensionReturnType(typeof(BoolToBrushConverter))] 10 | [ValueConversion(typeof(bool), typeof(SolidColorBrush))] 11 | public class BoolToBrushConverter : MarkupExtension, IValueConverter 12 | { 13 | public SolidColorBrush WhenTrue { get; set; } = Brushes.Red; 14 | 15 | public SolidColorBrush WhenFalse { get; set; } = Brushes.Transparent; 16 | 17 | public override object ProvideValue(IServiceProvider serviceProvider) 18 | { 19 | return this; 20 | } 21 | 22 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 23 | { 24 | return Equals(value, true) ? this.WhenTrue : this.WhenFalse; 25 | } 26 | 27 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 28 | { 29 | throw new NotSupportedException(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Gu.Wpf.ValidationScope.Demo/Converters/NullToVisibilityConverter.cs: -------------------------------------------------------------------------------- 1 | namespace Gu.Wpf.ValidationScope.Demo; 2 | 3 | using System; 4 | using System.Globalization; 5 | using System.Windows; 6 | using System.Windows.Data; 7 | 8 | [ValueConversion(typeof(object), typeof(Visibility))] 9 | public sealed class NullToVisibilityConverter : IValueConverter 10 | { 11 | public static readonly NullToVisibilityConverter CollapsedWhenNull = new(Visibility.Collapsed); 12 | private readonly Visibility whenNull; 13 | 14 | private NullToVisibilityConverter(Visibility whenNull) 15 | { 16 | this.whenNull = whenNull; 17 | } 18 | 19 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 20 | { 21 | return value is null ? this.whenNull : Visibility.Visible; 22 | } 23 | 24 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 25 | { 26 | throw new NotSupportedException(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Gu.Wpf.ValidationScope.Demo/DataGridScopeView.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 25 | 29 | 30 | 32 | 33 | 35 | 36 | 38 | 39 | 41 | 42 | 43 | 44 | 45 |