From 237817dca060ffbb7067ef9d156d439fae364bf1 Mon Sep 17 00:00:00 2001 From: Justin Swanson Date: Wed, 29 Jul 2020 21:34:59 -0500 Subject: [PATCH 1/6] Removed unused viewmodel parameter on ExecuteHook ViewModel objects are passed in mainly to help enforce generic typing without the user needing to manually type in all the generics themselves. Being passed to this internal functionality as object seems unnecessary --- src/ReactiveUI.Winforms/ContentControlBindingHook.cs | 2 +- src/ReactiveUI/Interfaces/IPropertyBindingHook.cs | 2 -- .../Platforms/windows-common/AutoDataTemplateBindingHook.cs | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ReactiveUI.Winforms/ContentControlBindingHook.cs b/src/ReactiveUI.Winforms/ContentControlBindingHook.cs index a908523aff..ac57a7416f 100644 --- a/src/ReactiveUI.Winforms/ContentControlBindingHook.cs +++ b/src/ReactiveUI.Winforms/ContentControlBindingHook.cs @@ -17,7 +17,7 @@ namespace ReactiveUI.Winforms public class ContentControlBindingHook : IPropertyBindingHook { /// - public bool ExecuteHook(object source, object target, Func[]> getCurrentViewModelProperties, Func[]> getCurrentViewProperties, BindingDirection direction) + public bool ExecuteHook(object target, Func[]> getCurrentViewModelProperties, Func[]> getCurrentViewProperties, BindingDirection direction) { if (getCurrentViewProperties == null) { diff --git a/src/ReactiveUI/Interfaces/IPropertyBindingHook.cs b/src/ReactiveUI/Interfaces/IPropertyBindingHook.cs index 65c1df7398..c1c7995192 100644 --- a/src/ReactiveUI/Interfaces/IPropertyBindingHook.cs +++ b/src/ReactiveUI/Interfaces/IPropertyBindingHook.cs @@ -17,13 +17,11 @@ public interface IPropertyBindingHook /// Called when any binding is set up. /// /// If false, the binding is cancelled. - /// The source ViewModel. /// The target View (not the actual control). /// Get current view model properties. /// Get current view properties. /// The Binding direction. bool ExecuteHook( - object source, object target, Func[]> getCurrentViewModelProperties, Func[]> getCurrentViewProperties, diff --git a/src/ReactiveUI/Platforms/windows-common/AutoDataTemplateBindingHook.cs b/src/ReactiveUI/Platforms/windows-common/AutoDataTemplateBindingHook.cs index 124d44fdb9..eb94359ce4 100644 --- a/src/ReactiveUI/Platforms/windows-common/AutoDataTemplateBindingHook.cs +++ b/src/ReactiveUI/Platforms/windows-common/AutoDataTemplateBindingHook.cs @@ -56,7 +56,7 @@ public class AutoDataTemplateBindingHook : IPropertyBindingHook }); /// - public bool ExecuteHook(object source, object target, Func[]> getCurrentViewModelProperties, Func[]> getCurrentViewProperties, BindingDirection direction) + public bool ExecuteHook(object target, Func[]> getCurrentViewModelProperties, Func[]> getCurrentViewProperties, BindingDirection direction) { if (getCurrentViewProperties == null) { From 1ff631d588b3b0aaf0837f6225dca42f8951875d Mon Sep 17 00:00:00 2001 From: Justin Swanson Date: Wed, 29 Jul 2020 21:37:14 -0500 Subject: [PATCH 2/6] Bind mixins viewmodel parameter made nullable The parameter is mainly there to simplify generic specification for the calling user. Therefore, it doesn't matter if it is null. Making the parameter nullable means it lines up cleaner with ReactiveControl's ViewModel member, which is 99% of the time what is being passed in. --- .../Property/IPropertyBinderImplementation.cs | 8 ++--- .../Property/PropertyBinderImplementation.cs | 31 ++++++++++++++----- .../Property/PropertyBindingMixins.cs | 12 +++---- src/ReactiveUI/Expression/Reflection.cs | 2 +- 4 files changed, 34 insertions(+), 19 deletions(-) diff --git a/src/ReactiveUI/Bindings/Property/IPropertyBinderImplementation.cs b/src/ReactiveUI/Bindings/Property/IPropertyBinderImplementation.cs index 826f56ef16..dc68f54362 100644 --- a/src/ReactiveUI/Bindings/Property/IPropertyBinderImplementation.cs +++ b/src/ReactiveUI/Bindings/Property/IPropertyBinderImplementation.cs @@ -65,7 +65,7 @@ public interface IPropertyBinderImplementation : IEnableLogger /// disconnects the binding. /// IReactiveBinding? Bind( - TViewModel viewModel, + TViewModel? viewModel, TView view, Expression> vmProperty, Expression> viewProperty, @@ -122,7 +122,7 @@ public interface IPropertyBinderImplementation : IEnableLogger /// disconnects the binding. /// IReactiveBinding? Bind( - TViewModel viewModel, + TViewModel? viewModel, TView view, Expression> vmProperty, Expression> viewProperty, @@ -172,7 +172,7 @@ public interface IPropertyBinderImplementation : IEnableLogger /// There is no registered converter from to . /// IReactiveBinding? OneWayBind( - TViewModel viewModel, + TViewModel? viewModel, TView view, Expression> vmProperty, Expression> viewProperty, @@ -213,7 +213,7 @@ public interface IPropertyBinderImplementation : IEnableLogger /// disconnects the binding. /// IReactiveBinding? OneWayBind( - TViewModel viewModel, + TViewModel? viewModel, TView view, Expression> vmProperty, Expression> viewProperty, diff --git a/src/ReactiveUI/Bindings/Property/PropertyBinderImplementation.cs b/src/ReactiveUI/Bindings/Property/PropertyBinderImplementation.cs index 1d1a78d20b..22b97b9b1b 100644 --- a/src/ReactiveUI/Bindings/Property/PropertyBinderImplementation.cs +++ b/src/ReactiveUI/Bindings/Property/PropertyBinderImplementation.cs @@ -48,7 +48,7 @@ public class PropertyBinderImplementation : IPropertyBinderImplementation /// public IReactiveBinding Bind( - TViewModel viewModel, + TViewModel? viewModel, TView view, Expression> vmProperty, Expression> viewProperty, @@ -91,7 +91,7 @@ bool ViewToVmFunc(TVProp vValue, out TVMProp vmValue) /// public IReactiveBinding? Bind( - TViewModel viewModel, + TViewModel? viewModel, TView view, Expression> vmProperty, Expression> viewProperty, @@ -138,7 +138,7 @@ bool ViewToVmFunc(TVProp vValue, out TVMProp vmValue) /// public IReactiveBinding? OneWayBind( - TViewModel viewModel, + TViewModel? viewModel, TView view, Expression> vmProperty, Expression> viewProperty, @@ -157,6 +157,11 @@ bool ViewToVmFunc(TVProp vValue, out TVMProp vmValue) throw new ArgumentNullException(nameof(viewProperty)); } + if (viewModel == null) + { + throw new ArgumentNullException(nameof(viewModel)); + } + var vmExpression = Reflection.Rewrite(vmProperty.Body); var viewExpression = Reflection.Rewrite(viewProperty.Body); var viewType = viewExpression.Type; @@ -191,7 +196,7 @@ bool ViewToVmFunc(TVProp vValue, out TVMProp vmValue) /// public IReactiveBinding? OneWayBind( - TViewModel viewModel, + TViewModel? viewModel, TView view, Expression> vmProperty, Expression> viewProperty, @@ -209,6 +214,11 @@ bool ViewToVmFunc(TVProp vValue, out TVMProp vmValue) throw new ArgumentNullException(nameof(viewProperty)); } + if (viewModel == null) + { + throw new ArgumentNullException(nameof(viewModel)); + } + var vmExpression = Reflection.Rewrite(vmProperty.Body); var viewExpression = Reflection.Rewrite(viewProperty.Body); var ret = EvalBindingHooks(viewModel, view, vmExpression, viewExpression, BindingDirection.OneWay); @@ -353,7 +363,7 @@ public IDisposable BindTo( return (setObservable.Subscribe(_ => { }, ex => this.Log().Error(ex, $"{viewExpression} Binding received an Exception!")), setObservable); } - private bool EvalBindingHooks(TViewModel viewModel, TView view, Expression vmExpression, Expression viewExpression, BindingDirection direction) + private bool EvalBindingHooks(TViewModel? viewModel, TView view, Expression vmExpression, Expression viewExpression, BindingDirection direction) where TViewModel : class { var hooks = Locator.Current.GetServices(); @@ -376,7 +386,7 @@ private bool EvalBindingHooks(TViewModel viewModel, TView vie { vmFetcher = () => new IObservedChange[] { - new ObservedChange(null!, null!, viewModel) + new ObservedChange(null!, null!, viewModel) }; } @@ -387,7 +397,7 @@ private bool EvalBindingHooks(TViewModel viewModel, TView vie }); var shouldBind = hooks.Aggregate(true, (acc, x) => - acc && x.ExecuteHook(viewModel, view, vmFetcher!, vFetcher!, direction)); + acc && x.ExecuteHook(view, vmFetcher!, vFetcher!, direction)); if (!shouldBind) { @@ -400,7 +410,7 @@ private bool EvalBindingHooks(TViewModel viewModel, TView vie } private IReactiveBinding BindImpl( - TViewModel viewModel, + TViewModel? viewModel, TView view, Expression> vmProperty, Expression> viewProperty, @@ -420,6 +430,11 @@ private bool EvalBindingHooks(TViewModel viewModel, TView vie throw new ArgumentNullException(nameof(viewProperty)); } + if (viewModel == null) + { + throw new ArgumentNullException(nameof(viewModel)); + } + var signalInitialUpdate = new Subject(); var vmExpression = Reflection.Rewrite(vmProperty.Body); var viewExpression = Reflection.Rewrite(viewProperty.Body); diff --git a/src/ReactiveUI/Bindings/Property/PropertyBindingMixins.cs b/src/ReactiveUI/Bindings/Property/PropertyBindingMixins.cs index 2f1b7bcd58..2ce6b390a0 100644 --- a/src/ReactiveUI/Bindings/Property/PropertyBindingMixins.cs +++ b/src/ReactiveUI/Bindings/Property/PropertyBindingMixins.cs @@ -59,7 +59,7 @@ static PropertyBindingMixins() /// public static IReactiveBinding? Bind( this TView view, - TViewModel viewModel, + TViewModel? viewModel, Expression> vmProperty, Expression> viewProperty, object? conversionHint = null, @@ -126,7 +126,7 @@ static PropertyBindingMixins() /// public static IReactiveBinding? Bind( this TView view, - TViewModel viewModel, + TViewModel? viewModel, Expression> vmProperty, Expression> viewProperty, IObservable? signalViewUpdate, @@ -170,7 +170,7 @@ static PropertyBindingMixins() /// public static IReactiveBinding? Bind( this TView view, - TViewModel viewModel, + TViewModel? viewModel, Expression> vmProperty, Expression> viewProperty, Func vmToViewConverter, @@ -220,7 +220,7 @@ static PropertyBindingMixins() /// public static IReactiveBinding? Bind( this TView view, - TViewModel viewModel, + TViewModel? viewModel, Expression> vmProperty, Expression> viewProperty, IObservable? signalViewUpdate, @@ -270,7 +270,7 @@ static PropertyBindingMixins() /// public static IReactiveBinding? OneWayBind( this TView view, - TViewModel viewModel, + TViewModel? viewModel, Expression> vmProperty, Expression> viewProperty, object? conversionHint = null, @@ -319,7 +319,7 @@ static PropertyBindingMixins() /// public static IReactiveBinding? OneWayBind( this TView view, - TViewModel viewModel, + TViewModel? viewModel, Expression> vmProperty, Expression> viewProperty, Func selector) diff --git a/src/ReactiveUI/Expression/Reflection.cs b/src/ReactiveUI/Expression/Reflection.cs index 7f5938e551..2b27d5a233 100644 --- a/src/ReactiveUI/Expression/Reflection.cs +++ b/src/ReactiveUI/Expression/Reflection.cs @@ -433,7 +433,7 @@ public static bool IsStatic(this PropertyInfo item) } [SuppressMessage("Microsoft.Performance", "CA1801", Justification = "TViewModel used to help generic calling.")] - internal static IObservable ViewModelWhenAnyValue(TViewModel viewModel, TView view, Expression expression) + internal static IObservable ViewModelWhenAnyValue(TViewModel? viewModel, TView view, Expression expression) where TView : class, IViewFor where TViewModel : class { From 41bb83f9a764f646d58f83dfa683b28a39ff62c6 Mon Sep 17 00:00:00 2001 From: Justin Swanson Date: Wed, 29 Jul 2020 21:34:59 -0500 Subject: [PATCH 3/6] Revert "Removed unused viewmodel parameter on ExecuteHook" This reverts commit 237817dca060ffbb7067ef9d156d439fae364bf1. --- src/ReactiveUI.Winforms/ContentControlBindingHook.cs | 2 +- src/ReactiveUI/Interfaces/IPropertyBindingHook.cs | 2 ++ .../Platforms/windows-common/AutoDataTemplateBindingHook.cs | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ReactiveUI.Winforms/ContentControlBindingHook.cs b/src/ReactiveUI.Winforms/ContentControlBindingHook.cs index ac57a7416f..a908523aff 100644 --- a/src/ReactiveUI.Winforms/ContentControlBindingHook.cs +++ b/src/ReactiveUI.Winforms/ContentControlBindingHook.cs @@ -17,7 +17,7 @@ namespace ReactiveUI.Winforms public class ContentControlBindingHook : IPropertyBindingHook { /// - public bool ExecuteHook(object target, Func[]> getCurrentViewModelProperties, Func[]> getCurrentViewProperties, BindingDirection direction) + public bool ExecuteHook(object source, object target, Func[]> getCurrentViewModelProperties, Func[]> getCurrentViewProperties, BindingDirection direction) { if (getCurrentViewProperties == null) { diff --git a/src/ReactiveUI/Interfaces/IPropertyBindingHook.cs b/src/ReactiveUI/Interfaces/IPropertyBindingHook.cs index c1c7995192..65c1df7398 100644 --- a/src/ReactiveUI/Interfaces/IPropertyBindingHook.cs +++ b/src/ReactiveUI/Interfaces/IPropertyBindingHook.cs @@ -17,11 +17,13 @@ public interface IPropertyBindingHook /// Called when any binding is set up. /// /// If false, the binding is cancelled. + /// The source ViewModel. /// The target View (not the actual control). /// Get current view model properties. /// Get current view properties. /// The Binding direction. bool ExecuteHook( + object source, object target, Func[]> getCurrentViewModelProperties, Func[]> getCurrentViewProperties, diff --git a/src/ReactiveUI/Platforms/windows-common/AutoDataTemplateBindingHook.cs b/src/ReactiveUI/Platforms/windows-common/AutoDataTemplateBindingHook.cs index eb94359ce4..124d44fdb9 100644 --- a/src/ReactiveUI/Platforms/windows-common/AutoDataTemplateBindingHook.cs +++ b/src/ReactiveUI/Platforms/windows-common/AutoDataTemplateBindingHook.cs @@ -56,7 +56,7 @@ public class AutoDataTemplateBindingHook : IPropertyBindingHook }); /// - public bool ExecuteHook(object target, Func[]> getCurrentViewModelProperties, Func[]> getCurrentViewProperties, BindingDirection direction) + public bool ExecuteHook(object source, object target, Func[]> getCurrentViewModelProperties, Func[]> getCurrentViewProperties, BindingDirection direction) { if (getCurrentViewProperties == null) { From f9170cf79ffee584963f9cead4b1ecb3a188962e Mon Sep 17 00:00:00 2001 From: Justin Swanson Date: Wed, 29 Jul 2020 22:16:23 -0500 Subject: [PATCH 4/6] Tied up loose ends with the commit reversal --- .../Bindings/Property/PropertyBinderImplementation.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ReactiveUI/Bindings/Property/PropertyBinderImplementation.cs b/src/ReactiveUI/Bindings/Property/PropertyBinderImplementation.cs index 22b97b9b1b..41d70fcaf8 100644 --- a/src/ReactiveUI/Bindings/Property/PropertyBinderImplementation.cs +++ b/src/ReactiveUI/Bindings/Property/PropertyBinderImplementation.cs @@ -363,7 +363,7 @@ public IDisposable BindTo( return (setObservable.Subscribe(_ => { }, ex => this.Log().Error(ex, $"{viewExpression} Binding received an Exception!")), setObservable); } - private bool EvalBindingHooks(TViewModel? viewModel, TView view, Expression vmExpression, Expression viewExpression, BindingDirection direction) + private bool EvalBindingHooks(TViewModel viewModel, TView view, Expression vmExpression, Expression viewExpression, BindingDirection direction) where TViewModel : class { var hooks = Locator.Current.GetServices(); @@ -397,7 +397,7 @@ private bool EvalBindingHooks(TViewModel? viewModel, TView vi }); var shouldBind = hooks.Aggregate(true, (acc, x) => - acc && x.ExecuteHook(view, vmFetcher!, vFetcher!, direction)); + acc && x.ExecuteHook(viewModel, view, vmFetcher!, vFetcher!, direction)); if (!shouldBind) { From 1319854fc2c8fc09bc2bf5a18598ad40e6159a6f Mon Sep 17 00:00:00 2001 From: Justin Swanson Date: Wed, 29 Jul 2020 22:31:58 -0500 Subject: [PATCH 5/6] Removed ArgumentNullExceptions. Offset /w some nullable params --- .../ContentControlBindingHook.cs | 2 +- .../Property/PropertyBinderImplementation.cs | 19 ++----------------- .../Bindings/Reactive/IReactiveBinding.cs | 2 +- .../Bindings/Reactive/ReactiveBinding.cs | 4 ++-- .../Interfaces/IPropertyBindingHook.cs | 2 +- .../AutoDataTemplateBindingHook.cs | 2 +- 6 files changed, 8 insertions(+), 23 deletions(-) diff --git a/src/ReactiveUI.Winforms/ContentControlBindingHook.cs b/src/ReactiveUI.Winforms/ContentControlBindingHook.cs index a908523aff..d889bde808 100644 --- a/src/ReactiveUI.Winforms/ContentControlBindingHook.cs +++ b/src/ReactiveUI.Winforms/ContentControlBindingHook.cs @@ -17,7 +17,7 @@ namespace ReactiveUI.Winforms public class ContentControlBindingHook : IPropertyBindingHook { /// - public bool ExecuteHook(object source, object target, Func[]> getCurrentViewModelProperties, Func[]> getCurrentViewProperties, BindingDirection direction) + public bool ExecuteHook(object? source, object target, Func[]> getCurrentViewModelProperties, Func[]> getCurrentViewProperties, BindingDirection direction) { if (getCurrentViewProperties == null) { diff --git a/src/ReactiveUI/Bindings/Property/PropertyBinderImplementation.cs b/src/ReactiveUI/Bindings/Property/PropertyBinderImplementation.cs index 41d70fcaf8..6ff3330a9b 100644 --- a/src/ReactiveUI/Bindings/Property/PropertyBinderImplementation.cs +++ b/src/ReactiveUI/Bindings/Property/PropertyBinderImplementation.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. +// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -157,11 +157,6 @@ bool ViewToVmFunc(TVProp vValue, out TVMProp vmValue) throw new ArgumentNullException(nameof(viewProperty)); } - if (viewModel == null) - { - throw new ArgumentNullException(nameof(viewModel)); - } - var vmExpression = Reflection.Rewrite(vmProperty.Body); var viewExpression = Reflection.Rewrite(viewProperty.Body); var viewType = viewExpression.Type; @@ -214,11 +209,6 @@ bool ViewToVmFunc(TVProp vValue, out TVMProp vmValue) throw new ArgumentNullException(nameof(viewProperty)); } - if (viewModel == null) - { - throw new ArgumentNullException(nameof(viewModel)); - } - var vmExpression = Reflection.Rewrite(vmProperty.Body); var viewExpression = Reflection.Rewrite(viewProperty.Body); var ret = EvalBindingHooks(viewModel, view, vmExpression, viewExpression, BindingDirection.OneWay); @@ -363,7 +353,7 @@ public IDisposable BindTo( return (setObservable.Subscribe(_ => { }, ex => this.Log().Error(ex, $"{viewExpression} Binding received an Exception!")), setObservable); } - private bool EvalBindingHooks(TViewModel viewModel, TView view, Expression vmExpression, Expression viewExpression, BindingDirection direction) + private bool EvalBindingHooks(TViewModel? viewModel, TView view, Expression vmExpression, Expression viewExpression, BindingDirection direction) where TViewModel : class { var hooks = Locator.Current.GetServices(); @@ -430,11 +420,6 @@ private bool EvalBindingHooks(TViewModel viewModel, TView vie throw new ArgumentNullException(nameof(viewProperty)); } - if (viewModel == null) - { - throw new ArgumentNullException(nameof(viewModel)); - } - var signalInitialUpdate = new Subject(); var vmExpression = Reflection.Rewrite(vmProperty.Body); var viewExpression = Reflection.Rewrite(viewProperty.Body); diff --git a/src/ReactiveUI/Bindings/Reactive/IReactiveBinding.cs b/src/ReactiveUI/Bindings/Reactive/IReactiveBinding.cs index b856a5ea54..bf5c9bcd7e 100644 --- a/src/ReactiveUI/Bindings/Reactive/IReactiveBinding.cs +++ b/src/ReactiveUI/Bindings/Reactive/IReactiveBinding.cs @@ -24,7 +24,7 @@ public interface IReactiveBinding : IDisp /// /// Gets the instance of the view model this binding is applied to. /// - TViewModel ViewModel { get; } + TViewModel? ViewModel { get; } /// /// Gets an expression representing the propertyon the viewmodel bound to the view. diff --git a/src/ReactiveUI/Bindings/Reactive/ReactiveBinding.cs b/src/ReactiveUI/Bindings/Reactive/ReactiveBinding.cs index 61ec5f5235..6daee7cad3 100644 --- a/src/ReactiveUI/Bindings/Reactive/ReactiveBinding.cs +++ b/src/ReactiveUI/Bindings/Reactive/ReactiveBinding.cs @@ -16,7 +16,7 @@ internal class ReactiveBinding : IReactiveBinding changed, @@ -34,7 +34,7 @@ public ReactiveBinding( } /// - public TViewModel ViewModel { get; } + public TViewModel? ViewModel { get; } /// public Expression ViewModelExpression { get; } diff --git a/src/ReactiveUI/Interfaces/IPropertyBindingHook.cs b/src/ReactiveUI/Interfaces/IPropertyBindingHook.cs index 65c1df7398..be2a9126e2 100644 --- a/src/ReactiveUI/Interfaces/IPropertyBindingHook.cs +++ b/src/ReactiveUI/Interfaces/IPropertyBindingHook.cs @@ -23,7 +23,7 @@ public interface IPropertyBindingHook /// Get current view properties. /// The Binding direction. bool ExecuteHook( - object source, + object? source, object target, Func[]> getCurrentViewModelProperties, Func[]> getCurrentViewProperties, diff --git a/src/ReactiveUI/Platforms/windows-common/AutoDataTemplateBindingHook.cs b/src/ReactiveUI/Platforms/windows-common/AutoDataTemplateBindingHook.cs index 124d44fdb9..1a220af880 100644 --- a/src/ReactiveUI/Platforms/windows-common/AutoDataTemplateBindingHook.cs +++ b/src/ReactiveUI/Platforms/windows-common/AutoDataTemplateBindingHook.cs @@ -56,7 +56,7 @@ public class AutoDataTemplateBindingHook : IPropertyBindingHook }); /// - public bool ExecuteHook(object source, object target, Func[]> getCurrentViewModelProperties, Func[]> getCurrentViewProperties, BindingDirection direction) + public bool ExecuteHook(object? source, object target, Func[]> getCurrentViewModelProperties, Func[]> getCurrentViewProperties, BindingDirection direction) { if (getCurrentViewProperties == null) { From 816e79883f7db6528b9412b6bb5e6811f73300e4 Mon Sep 17 00:00:00 2001 From: Justin Swanson Date: Thu, 30 Jul 2020 21:48:35 -0500 Subject: [PATCH 6/6] Modified API agreement text files --- ...provalTests.ReactiveUI.net472.approved.txt | 36 +++++++++---------- ...ests.ReactiveUI.netcoreapp3.1.approved.txt | 36 +++++++++---------- ...ApprovalTests.Winforms.net472.approved.txt | 2 +- ...lTests.Winforms.netcoreapp3.1.approved.txt | 2 +- 4 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.net472.approved.txt b/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.net472.approved.txt index 0bbd2e99d6..ef382c6fd4 100644 --- a/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.net472.approved.txt +++ b/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.net472.approved.txt @@ -216,32 +216,32 @@ namespace ReactiveUI [return: System.Runtime.CompilerServices.TupleElementNames(new string[] { "view", "isViewModel"})] - ReactiveUI.IReactiveBinding>? Bind(TViewModel viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.IObservable? signalViewUpdate, System.Func vmToViewConverter, System.Func viewToVmConverter) + ReactiveUI.IReactiveBinding>? Bind(TViewModel? viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.IObservable? signalViewUpdate, System.Func vmToViewConverter, System.Func viewToVmConverter) where TViewModel : class where TView : class, ReactiveUI.IViewFor ; - [return: System.Runtime.CompilerServices.TupleElementNames(new string[] { + [return: System.Runtime.CompilerServices.TupleElementNames(new string?[]?[] { "view", "isViewModel"})] - ReactiveUI.IReactiveBinding>? Bind(TViewModel viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.IObservable? signalViewUpdate, object? conversionHint, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null, ReactiveUI.IBindingTypeConverter? viewToVMConverterOverride = null) + ReactiveUI.IReactiveBinding>? Bind(TViewModel? viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.IObservable? signalViewUpdate, object? conversionHint, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null, ReactiveUI.IBindingTypeConverter? viewToVMConverterOverride = null) where TViewModel : class where TView : class, ReactiveUI.IViewFor ; System.IDisposable BindTo(System.IObservable observedChange, TTarget target, System.Linq.Expressions.Expression> propertyExpression, object? conversionHint, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null) where TTarget : class ; - ReactiveUI.IReactiveBinding? OneWayBind(TViewModel viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.Func selector) + ReactiveUI.IReactiveBinding? OneWayBind(TViewModel? viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.Func selector) where TViewModel : class where TView : class, ReactiveUI.IViewFor ; - ReactiveUI.IReactiveBinding? OneWayBind(TViewModel viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, object? conversionHint, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null) + ReactiveUI.IReactiveBinding? OneWayBind(TViewModel? viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, object? conversionHint, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null) where TViewModel : class where TView : class, ReactiveUI.IViewFor ; } public interface IPropertyBindingHook { - bool ExecuteHook(object source, object target, System.Func[]> getCurrentViewModelProperties, System.Func[]> getCurrentViewProperties, ReactiveUI.BindingDirection direction); + bool ExecuteHook(object? source, object target, System.Func[]> getCurrentViewModelProperties, System.Func[]> getCurrentViewProperties, ReactiveUI.BindingDirection direction); } public class IROObservableForProperty : ReactiveUI.ICreatesObservableForProperty, Splat.IEnableLogger { @@ -433,21 +433,21 @@ namespace ReactiveUI [return: System.Runtime.CompilerServices.TupleElementNames(new string[] { "view", "isViewModel"})] - public ReactiveUI.IReactiveBinding>? Bind(TViewModel viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.IObservable? signalViewUpdate, System.Func vmToViewConverter, System.Func viewToVmConverter) + public ReactiveUI.IReactiveBinding>? Bind(TViewModel? viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.IObservable? signalViewUpdate, System.Func vmToViewConverter, System.Func viewToVmConverter) where TViewModel : class where TView : class, ReactiveUI.IViewFor { } - [return: System.Runtime.CompilerServices.TupleElementNames(new string[] { + [return: System.Runtime.CompilerServices.TupleElementNames(new string?[]?[] { "view", "isViewModel"})] - public ReactiveUI.IReactiveBinding> Bind(TViewModel viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.IObservable? signalViewUpdate, object? conversionHint, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null, ReactiveUI.IBindingTypeConverter? viewToVMConverterOverride = null) + public ReactiveUI.IReactiveBinding> Bind(TViewModel? viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.IObservable? signalViewUpdate, object? conversionHint, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null, ReactiveUI.IBindingTypeConverter? viewToVMConverterOverride = null) where TViewModel : class where TView : class, ReactiveUI.IViewFor { } public System.IDisposable BindTo(System.IObservable observedChange, TTarget target, System.Linq.Expressions.Expression> propertyExpression, object? conversionHint = null, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null) where TTarget : class { } - public ReactiveUI.IReactiveBinding? OneWayBind(TViewModel viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.Func selector) + public ReactiveUI.IReactiveBinding? OneWayBind(TViewModel? viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.Func selector) where TViewModel : class where TView : class, ReactiveUI.IViewFor { } - public ReactiveUI.IReactiveBinding? OneWayBind(TViewModel viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, object? conversionHint = null, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null) + public ReactiveUI.IReactiveBinding? OneWayBind(TViewModel? viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, object? conversionHint = null, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null) where TViewModel : class where TView : class, ReactiveUI.IViewFor { } } @@ -456,33 +456,33 @@ namespace ReactiveUI [return: System.Runtime.CompilerServices.TupleElementNames(new string[] { "view", "isViewModel"})] - public static ReactiveUI.IReactiveBinding>? Bind(this TView view, TViewModel viewModel, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.Func vmToViewConverter, System.Func viewToVmConverter) + public static ReactiveUI.IReactiveBinding>? Bind(this TView view, TViewModel? viewModel, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.Func vmToViewConverter, System.Func viewToVmConverter) where TViewModel : class where TView : class, ReactiveUI.IViewFor { } [return: System.Runtime.CompilerServices.TupleElementNames(new string[] { "view", "isViewModel"})] - public static ReactiveUI.IReactiveBinding>? Bind(this TView view, TViewModel viewModel, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, object? conversionHint = null, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null, ReactiveUI.IBindingTypeConverter? viewToVMConverterOverride = null) + public static ReactiveUI.IReactiveBinding>? Bind(this TView view, TViewModel? viewModel, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, object? conversionHint = null, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null, ReactiveUI.IBindingTypeConverter? viewToVMConverterOverride = null) where TViewModel : class where TView : class, ReactiveUI.IViewFor { } [return: System.Runtime.CompilerServices.TupleElementNames(new string[] { "view", "isViewModel"})] - public static ReactiveUI.IReactiveBinding>? Bind(this TView view, TViewModel viewModel, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.IObservable? signalViewUpdate, System.Func vmToViewConverter, System.Func viewToVmConverter) + public static ReactiveUI.IReactiveBinding>? Bind(this TView view, TViewModel? viewModel, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.IObservable? signalViewUpdate, System.Func vmToViewConverter, System.Func viewToVmConverter) where TViewModel : class where TView : class, ReactiveUI.IViewFor { } - [return: System.Runtime.CompilerServices.TupleElementNames(new string[] { + [return: System.Runtime.CompilerServices.TupleElementNames(new string?[]?[] { "view", "isViewModel"})] - public static ReactiveUI.IReactiveBinding>? Bind(this TView view, TViewModel viewModel, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.IObservable? signalViewUpdate, object? conversionHint = null, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null, ReactiveUI.IBindingTypeConverter? viewToVMConverterOverride = null) + public static ReactiveUI.IReactiveBinding>? Bind(this TView view, TViewModel? viewModel, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.IObservable? signalViewUpdate, object? conversionHint = null, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null, ReactiveUI.IBindingTypeConverter? viewToVMConverterOverride = null) where TViewModel : class where TView : class, ReactiveUI.IViewFor { } public static System.IDisposable BindTo(this System.IObservable @this, TTarget target, System.Linq.Expressions.Expression> property, object? conversionHint = null, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null) where TTarget : class { } - public static ReactiveUI.IReactiveBinding? OneWayBind(this TView view, TViewModel viewModel, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.Func selector) + public static ReactiveUI.IReactiveBinding? OneWayBind(this TView view, TViewModel? viewModel, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.Func selector) where TViewModel : class where TView : class, ReactiveUI.IViewFor { } - public static ReactiveUI.IReactiveBinding? OneWayBind(this TView view, TViewModel viewModel, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, object? conversionHint = null, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null) + public static ReactiveUI.IReactiveBinding? OneWayBind(this TView view, TViewModel? viewModel, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, object? conversionHint = null, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null) where TViewModel : class where TView : class, ReactiveUI.IViewFor { } } diff --git a/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.netcoreapp3.1.approved.txt b/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.netcoreapp3.1.approved.txt index 48be053cf6..349ba27f6c 100644 --- a/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.netcoreapp3.1.approved.txt +++ b/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.netcoreapp3.1.approved.txt @@ -216,32 +216,32 @@ namespace ReactiveUI [return: System.Runtime.CompilerServices.TupleElementNames(new string[] { "view", "isViewModel"})] - ReactiveUI.IReactiveBinding>? Bind(TViewModel viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.IObservable? signalViewUpdate, System.Func vmToViewConverter, System.Func viewToVmConverter) + ReactiveUI.IReactiveBinding>? Bind(TViewModel? viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.IObservable? signalViewUpdate, System.Func vmToViewConverter, System.Func viewToVmConverter) where TViewModel : class where TView : class, ReactiveUI.IViewFor ; - [return: System.Runtime.CompilerServices.TupleElementNames(new string[] { + [return: System.Runtime.CompilerServices.TupleElementNames(new string?[]?[] { "view", "isViewModel"})] - ReactiveUI.IReactiveBinding>? Bind(TViewModel viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.IObservable? signalViewUpdate, object? conversionHint, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null, ReactiveUI.IBindingTypeConverter? viewToVMConverterOverride = null) + ReactiveUI.IReactiveBinding>? Bind(TViewModel? viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.IObservable? signalViewUpdate, object? conversionHint, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null, ReactiveUI.IBindingTypeConverter? viewToVMConverterOverride = null) where TViewModel : class where TView : class, ReactiveUI.IViewFor ; System.IDisposable BindTo(System.IObservable observedChange, TTarget target, System.Linq.Expressions.Expression> propertyExpression, object? conversionHint, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null) where TTarget : class ; - ReactiveUI.IReactiveBinding? OneWayBind(TViewModel viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.Func selector) + ReactiveUI.IReactiveBinding? OneWayBind(TViewModel? viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.Func selector) where TViewModel : class where TView : class, ReactiveUI.IViewFor ; - ReactiveUI.IReactiveBinding? OneWayBind(TViewModel viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, object? conversionHint, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null) + ReactiveUI.IReactiveBinding? OneWayBind(TViewModel? viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, object? conversionHint, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null) where TViewModel : class where TView : class, ReactiveUI.IViewFor ; } public interface IPropertyBindingHook { - bool ExecuteHook(object source, object target, System.Func[]> getCurrentViewModelProperties, System.Func[]> getCurrentViewProperties, ReactiveUI.BindingDirection direction); + bool ExecuteHook(object? source, object target, System.Func[]> getCurrentViewModelProperties, System.Func[]> getCurrentViewProperties, ReactiveUI.BindingDirection direction); } public class IROObservableForProperty : ReactiveUI.ICreatesObservableForProperty, Splat.IEnableLogger { @@ -433,21 +433,21 @@ namespace ReactiveUI [return: System.Runtime.CompilerServices.TupleElementNames(new string[] { "view", "isViewModel"})] - public ReactiveUI.IReactiveBinding>? Bind(TViewModel viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.IObservable? signalViewUpdate, System.Func vmToViewConverter, System.Func viewToVmConverter) + public ReactiveUI.IReactiveBinding>? Bind(TViewModel? viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.IObservable? signalViewUpdate, System.Func vmToViewConverter, System.Func viewToVmConverter) where TViewModel : class where TView : class, ReactiveUI.IViewFor { } - [return: System.Runtime.CompilerServices.TupleElementNames(new string[] { + [return: System.Runtime.CompilerServices.TupleElementNames(new string?[]?[] { "view", "isViewModel"})] - public ReactiveUI.IReactiveBinding> Bind(TViewModel viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.IObservable? signalViewUpdate, object? conversionHint, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null, ReactiveUI.IBindingTypeConverter? viewToVMConverterOverride = null) + public ReactiveUI.IReactiveBinding> Bind(TViewModel? viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.IObservable? signalViewUpdate, object? conversionHint, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null, ReactiveUI.IBindingTypeConverter? viewToVMConverterOverride = null) where TViewModel : class where TView : class, ReactiveUI.IViewFor { } public System.IDisposable BindTo(System.IObservable observedChange, TTarget target, System.Linq.Expressions.Expression> propertyExpression, object? conversionHint = null, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null) where TTarget : class { } - public ReactiveUI.IReactiveBinding? OneWayBind(TViewModel viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.Func selector) + public ReactiveUI.IReactiveBinding? OneWayBind(TViewModel? viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.Func selector) where TViewModel : class where TView : class, ReactiveUI.IViewFor { } - public ReactiveUI.IReactiveBinding? OneWayBind(TViewModel viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, object? conversionHint = null, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null) + public ReactiveUI.IReactiveBinding? OneWayBind(TViewModel? viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, object? conversionHint = null, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null) where TViewModel : class where TView : class, ReactiveUI.IViewFor { } } @@ -456,33 +456,33 @@ namespace ReactiveUI [return: System.Runtime.CompilerServices.TupleElementNames(new string[] { "view", "isViewModel"})] - public static ReactiveUI.IReactiveBinding>? Bind(this TView view, TViewModel viewModel, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.Func vmToViewConverter, System.Func viewToVmConverter) + public static ReactiveUI.IReactiveBinding>? Bind(this TView view, TViewModel? viewModel, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.Func vmToViewConverter, System.Func viewToVmConverter) where TViewModel : class where TView : class, ReactiveUI.IViewFor { } [return: System.Runtime.CompilerServices.TupleElementNames(new string[] { "view", "isViewModel"})] - public static ReactiveUI.IReactiveBinding>? Bind(this TView view, TViewModel viewModel, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, object? conversionHint = null, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null, ReactiveUI.IBindingTypeConverter? viewToVMConverterOverride = null) + public static ReactiveUI.IReactiveBinding>? Bind(this TView view, TViewModel? viewModel, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, object? conversionHint = null, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null, ReactiveUI.IBindingTypeConverter? viewToVMConverterOverride = null) where TViewModel : class where TView : class, ReactiveUI.IViewFor { } [return: System.Runtime.CompilerServices.TupleElementNames(new string[] { "view", "isViewModel"})] - public static ReactiveUI.IReactiveBinding>? Bind(this TView view, TViewModel viewModel, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.IObservable? signalViewUpdate, System.Func vmToViewConverter, System.Func viewToVmConverter) + public static ReactiveUI.IReactiveBinding>? Bind(this TView view, TViewModel? viewModel, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.IObservable? signalViewUpdate, System.Func vmToViewConverter, System.Func viewToVmConverter) where TViewModel : class where TView : class, ReactiveUI.IViewFor { } - [return: System.Runtime.CompilerServices.TupleElementNames(new string[] { + [return: System.Runtime.CompilerServices.TupleElementNames(new string?[]?[] { "view", "isViewModel"})] - public static ReactiveUI.IReactiveBinding>? Bind(this TView view, TViewModel viewModel, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.IObservable? signalViewUpdate, object? conversionHint = null, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null, ReactiveUI.IBindingTypeConverter? viewToVMConverterOverride = null) + public static ReactiveUI.IReactiveBinding>? Bind(this TView view, TViewModel? viewModel, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.IObservable? signalViewUpdate, object? conversionHint = null, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null, ReactiveUI.IBindingTypeConverter? viewToVMConverterOverride = null) where TViewModel : class where TView : class, ReactiveUI.IViewFor { } public static System.IDisposable BindTo(this System.IObservable @this, TTarget target, System.Linq.Expressions.Expression> property, object? conversionHint = null, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null) where TTarget : class { } - public static ReactiveUI.IReactiveBinding? OneWayBind(this TView view, TViewModel viewModel, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.Func selector) + public static ReactiveUI.IReactiveBinding? OneWayBind(this TView view, TViewModel? viewModel, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.Func selector) where TViewModel : class where TView : class, ReactiveUI.IViewFor { } - public static ReactiveUI.IReactiveBinding? OneWayBind(this TView view, TViewModel viewModel, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, object? conversionHint = null, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null) + public static ReactiveUI.IReactiveBinding? OneWayBind(this TView view, TViewModel? viewModel, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, object? conversionHint = null, ReactiveUI.IBindingTypeConverter? vmToViewConverterOverride = null) where TViewModel : class where TView : class, ReactiveUI.IViewFor { } } diff --git a/src/ReactiveUI.Tests/Platforms/winforms/API/ApiApprovalTests.Winforms.net472.approved.txt b/src/ReactiveUI.Tests/Platforms/winforms/API/ApiApprovalTests.Winforms.net472.approved.txt index b1babfa47d..56dc8107c9 100644 --- a/src/ReactiveUI.Tests/Platforms/winforms/API/ApiApprovalTests.Winforms.net472.approved.txt +++ b/src/ReactiveUI.Tests/Platforms/winforms/API/ApiApprovalTests.Winforms.net472.approved.txt @@ -10,7 +10,7 @@ namespace ReactiveUI.Winforms public class ContentControlBindingHook : ReactiveUI.IPropertyBindingHook { public ContentControlBindingHook() { } - public bool ExecuteHook(object source, object target, System.Func[]> getCurrentViewModelProperties, System.Func[]> getCurrentViewProperties, ReactiveUI.BindingDirection direction) { } + public bool ExecuteHook(object? source, object target, System.Func[]> getCurrentViewModelProperties, System.Func[]> getCurrentViewProperties, ReactiveUI.BindingDirection direction) { } } public class CreatesWinformsCommandBinding : ReactiveUI.ICreatesCommandBinding { diff --git a/src/ReactiveUI.Tests/Platforms/winforms/API/ApiApprovalTests.Winforms.netcoreapp3.1.approved.txt b/src/ReactiveUI.Tests/Platforms/winforms/API/ApiApprovalTests.Winforms.netcoreapp3.1.approved.txt index 9cbbe61b09..657513e73c 100644 --- a/src/ReactiveUI.Tests/Platforms/winforms/API/ApiApprovalTests.Winforms.netcoreapp3.1.approved.txt +++ b/src/ReactiveUI.Tests/Platforms/winforms/API/ApiApprovalTests.Winforms.netcoreapp3.1.approved.txt @@ -10,7 +10,7 @@ namespace ReactiveUI.Winforms public class ContentControlBindingHook : ReactiveUI.IPropertyBindingHook { public ContentControlBindingHook() { } - public bool ExecuteHook(object source, object target, System.Func[]> getCurrentViewModelProperties, System.Func[]> getCurrentViewProperties, ReactiveUI.BindingDirection direction) { } + public bool ExecuteHook(object? source, object target, System.Func[]> getCurrentViewModelProperties, System.Func[]> getCurrentViewProperties, ReactiveUI.BindingDirection direction) { } } public class CreatesWinformsCommandBinding : ReactiveUI.ICreatesCommandBinding {