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 { 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/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 6cce6402cf..2c8b0b0430 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. @@ -48,7 +48,7 @@ public class PropertyBinderImplementation : IPropertyBinderImplementation /// public IReactiveBinding Bind( - TViewModel viewModel, + TViewModel? viewModel, TView view, Expression> vmProperty, Expression> viewProperty, @@ -95,7 +95,7 @@ bool ViewToVmFunc(TVProp vValue, out TVMProp vmValue) /// public IReactiveBinding? Bind( - TViewModel viewModel, + TViewModel? viewModel, TView view, Expression> vmProperty, Expression> viewProperty, @@ -142,7 +142,7 @@ bool ViewToVmFunc(TVProp vValue, out TVMProp vmValue) /// public IReactiveBinding? OneWayBind( - TViewModel viewModel, + TViewModel? viewModel, TView view, Expression> vmProperty, Expression> viewProperty, @@ -195,7 +195,7 @@ bool ViewToVmFunc(TVProp vValue, out TVMProp vmValue) /// public IReactiveBinding? OneWayBind( - TViewModel viewModel, + TViewModel? viewModel, TView view, Expression> vmProperty, Expression> viewProperty, @@ -357,7 +357,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(); @@ -380,7 +380,7 @@ private bool EvalBindingHooks(TViewModel viewModel, TView vie { vmFetcher = () => new IObservedChange[] { - new ObservedChange(null!, null!, viewModel) + new ObservedChange(null!, null!, viewModel) }; } @@ -404,7 +404,7 @@ private bool EvalBindingHooks(TViewModel viewModel, TView vie } private IReactiveBinding BindImpl( - TViewModel viewModel, + TViewModel? viewModel, TView view, Expression> vmProperty, Expression> viewProperty, 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/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/Expression/Reflection.cs b/src/ReactiveUI/Expression/Reflection.cs index 63523cdcd0..6d91abba94 100644 --- a/src/ReactiveUI/Expression/Reflection.cs +++ b/src/ReactiveUI/Expression/Reflection.cs @@ -435,7 +435,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 { 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) {