Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,23 @@ namespace ReactiveUI
where TView : class, ReactiveUI.IViewFor<TViewModel>
where TViewModel : class
where TProp : System.Windows.Input.ICommand { }
public static ReactiveUI.IReactiveBinding<TView, TProp> BindCommand<TView, TViewModel, TProp, TControl, TParam>(this TView view, TViewModel? viewModel, System.Linq.Expressions.Expression<System.Func<TViewModel, TProp?>> propertyName, System.Linq.Expressions.Expression<System.Func<TView, TControl>> controlName, System.IObservable<TParam> withParameter, string? toEvent = null)
public static ReactiveUI.IReactiveBinding<TView, TProp> BindCommand<TView, TViewModel, TProp, TControl, TParam>(this TView view, TViewModel? viewModel, System.Linq.Expressions.Expression<System.Func<TViewModel, TProp?>> propertyName, System.Linq.Expressions.Expression<System.Func<TView, TControl>> controlName, System.IObservable<TParam?> withParameter, string? toEvent = null)
where TView : class, ReactiveUI.IViewFor<TViewModel>
where TViewModel : class
where TProp : System.Windows.Input.ICommand { }
public static ReactiveUI.IReactiveBinding<TView, TProp> BindCommand<TView, TViewModel, TProp, TControl, TParam>(this TView view, TViewModel? viewModel, System.Linq.Expressions.Expression<System.Func<TViewModel, TProp?>> propertyName, System.Linq.Expressions.Expression<System.Func<TView, TControl>> controlName, System.Linq.Expressions.Expression<System.Func<TViewModel, TParam>> withParameter, string? toEvent = null)
public static ReactiveUI.IReactiveBinding<TView, TProp> BindCommand<TView, TViewModel, TProp, TControl, TParam>(this TView view, TViewModel? viewModel, System.Linq.Expressions.Expression<System.Func<TViewModel, TProp?>> propertyName, System.Linq.Expressions.Expression<System.Func<TView, TControl>> controlName, System.Linq.Expressions.Expression<System.Func<TViewModel, TParam?>> withParameter, string? toEvent = null)
where TView : class, ReactiveUI.IViewFor<TViewModel>
where TViewModel : class
where TProp : System.Windows.Input.ICommand { }
}
public class CommandBinderImplementation : Splat.IEnableLogger
{
public CommandBinderImplementation() { }
public ReactiveUI.IReactiveBinding<TView, TProp> BindCommand<TView, TViewModel, TProp, TControl, TParam>(TViewModel? viewModel, TView view, System.Linq.Expressions.Expression<System.Func<TViewModel, TProp?>> vmProperty, System.Linq.Expressions.Expression<System.Func<TView, TControl>> controlProperty, System.Func<TParam> withParameter, string? toEvent = null)
public ReactiveUI.IReactiveBinding<TView, TProp> BindCommand<TView, TViewModel, TProp, TControl, TParam>(TViewModel? viewModel, TView view, System.Linq.Expressions.Expression<System.Func<TViewModel, TProp?>> vmProperty, System.Linq.Expressions.Expression<System.Func<TView, TControl>> controlProperty, System.IObservable<TParam?> withParameter, string? toEvent = null)
where TView : class, ReactiveUI.IViewFor<TViewModel>
where TViewModel : class
where TProp : System.Windows.Input.ICommand { }
public ReactiveUI.IReactiveBinding<TView, TProp> BindCommand<TView, TViewModel, TProp, TControl, TParam>(TViewModel? viewModel, TView view, System.Linq.Expressions.Expression<System.Func<TViewModel, TProp?>> vmProperty, System.Linq.Expressions.Expression<System.Func<TView, TControl>> controlProperty, System.IObservable<TParam> withParameter, string? toEvent = null)
public ReactiveUI.IReactiveBinding<TView, TProp> BindCommand<TView, TViewModel, TProp, TControl, TParam>(TViewModel? viewModel, TView view, System.Linq.Expressions.Expression<System.Func<TViewModel, TProp?>> vmProperty, System.Linq.Expressions.Expression<System.Func<TView, TControl>> controlProperty, System.Linq.Expressions.Expression<System.Func<TViewModel, TParam?>> withParameter, string? toEvent = null)
where TView : class, ReactiveUI.IViewFor<TViewModel>
where TViewModel : class
where TProp : System.Windows.Input.ICommand { }
Expand Down Expand Up @@ -431,6 +431,10 @@ namespace ReactiveUI
public void Dispose() { }
public static ReactiveUI.ObservableAsPropertyHelper<T> Default(T? initialValue = default, System.Reactive.Concurrency.IScheduler? scheduler = null) { }
}
public static class ObservableFuncMixins
{
public static System.IObservable<TResult?> ToObservable<TSource, TResult>(this TSource? source, System.Linq.Expressions.Expression<System.Func<TSource, TResult?>> expression, bool beforeChange = false, bool skipInitial = false) { }
}
public static class ObservableLoggingMixin
{
public static System.IObservable<T> Log<T, TObj>(this System.IObservable<T> @this, TObj logObject, string? message = null, System.Func<T, string>? stringifier = null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,23 +74,23 @@ namespace ReactiveUI
where TView : class, ReactiveUI.IViewFor<TViewModel>
where TViewModel : class
where TProp : System.Windows.Input.ICommand { }
public static ReactiveUI.IReactiveBinding<TView, TProp> BindCommand<TView, TViewModel, TProp, TControl, TParam>(this TView view, TViewModel? viewModel, System.Linq.Expressions.Expression<System.Func<TViewModel, TProp?>> propertyName, System.Linq.Expressions.Expression<System.Func<TView, TControl>> controlName, System.IObservable<TParam> withParameter, string? toEvent = null)
public static ReactiveUI.IReactiveBinding<TView, TProp> BindCommand<TView, TViewModel, TProp, TControl, TParam>(this TView view, TViewModel? viewModel, System.Linq.Expressions.Expression<System.Func<TViewModel, TProp?>> propertyName, System.Linq.Expressions.Expression<System.Func<TView, TControl>> controlName, System.IObservable<TParam?> withParameter, string? toEvent = null)
where TView : class, ReactiveUI.IViewFor<TViewModel>
where TViewModel : class
where TProp : System.Windows.Input.ICommand { }
public static ReactiveUI.IReactiveBinding<TView, TProp> BindCommand<TView, TViewModel, TProp, TControl, TParam>(this TView view, TViewModel? viewModel, System.Linq.Expressions.Expression<System.Func<TViewModel, TProp?>> propertyName, System.Linq.Expressions.Expression<System.Func<TView, TControl>> controlName, System.Linq.Expressions.Expression<System.Func<TViewModel, TParam>> withParameter, string? toEvent = null)
public static ReactiveUI.IReactiveBinding<TView, TProp> BindCommand<TView, TViewModel, TProp, TControl, TParam>(this TView view, TViewModel? viewModel, System.Linq.Expressions.Expression<System.Func<TViewModel, TProp?>> propertyName, System.Linq.Expressions.Expression<System.Func<TView, TControl>> controlName, System.Linq.Expressions.Expression<System.Func<TViewModel, TParam?>> withParameter, string? toEvent = null)
where TView : class, ReactiveUI.IViewFor<TViewModel>
where TViewModel : class
where TProp : System.Windows.Input.ICommand { }
}
public class CommandBinderImplementation : Splat.IEnableLogger
{
public CommandBinderImplementation() { }
public ReactiveUI.IReactiveBinding<TView, TProp> BindCommand<TView, TViewModel, TProp, TControl, TParam>(TViewModel? viewModel, TView view, System.Linq.Expressions.Expression<System.Func<TViewModel, TProp?>> vmProperty, System.Linq.Expressions.Expression<System.Func<TView, TControl>> controlProperty, System.Func<TParam> withParameter, string? toEvent = null)
public ReactiveUI.IReactiveBinding<TView, TProp> BindCommand<TView, TViewModel, TProp, TControl, TParam>(TViewModel? viewModel, TView view, System.Linq.Expressions.Expression<System.Func<TViewModel, TProp?>> vmProperty, System.Linq.Expressions.Expression<System.Func<TView, TControl>> controlProperty, System.IObservable<TParam?> withParameter, string? toEvent = null)
where TView : class, ReactiveUI.IViewFor<TViewModel>
where TViewModel : class
where TProp : System.Windows.Input.ICommand { }
public ReactiveUI.IReactiveBinding<TView, TProp> BindCommand<TView, TViewModel, TProp, TControl, TParam>(TViewModel? viewModel, TView view, System.Linq.Expressions.Expression<System.Func<TViewModel, TProp?>> vmProperty, System.Linq.Expressions.Expression<System.Func<TView, TControl>> controlProperty, System.IObservable<TParam> withParameter, string? toEvent = null)
public ReactiveUI.IReactiveBinding<TView, TProp> BindCommand<TView, TViewModel, TProp, TControl, TParam>(TViewModel? viewModel, TView view, System.Linq.Expressions.Expression<System.Func<TViewModel, TProp?>> vmProperty, System.Linq.Expressions.Expression<System.Func<TView, TControl>> controlProperty, System.Linq.Expressions.Expression<System.Func<TViewModel, TParam?>> withParameter, string? toEvent = null)
where TView : class, ReactiveUI.IViewFor<TViewModel>
where TViewModel : class
where TProp : System.Windows.Input.ICommand { }
Expand Down Expand Up @@ -426,6 +426,10 @@ namespace ReactiveUI
public void Dispose() { }
public static ReactiveUI.ObservableAsPropertyHelper<T> Default(T? initialValue = default, System.Reactive.Concurrency.IScheduler? scheduler = null) { }
}
public static class ObservableFuncMixins
{
public static System.IObservable<TResult?> ToObservable<TSource, TResult>(this TSource? source, System.Linq.Expressions.Expression<System.Func<TSource, TResult?>> expression, bool beforeChange = false, bool skipInitial = false) { }
}
public static class ObservableLoggingMixin
{
public static System.IObservable<T> Log<T, TObj>(this System.IObservable<T> @this, TObj logObject, string? message = null, System.Func<T, string>? stringifier = null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,23 @@ namespace ReactiveUI
where TView : class, ReactiveUI.IViewFor<TViewModel>
where TViewModel : class
where TProp : System.Windows.Input.ICommand { }
public static ReactiveUI.IReactiveBinding<TView, TProp> BindCommand<TView, TViewModel, TProp, TControl, TParam>(this TView view, TViewModel? viewModel, System.Linq.Expressions.Expression<System.Func<TViewModel, TProp?>> propertyName, System.Linq.Expressions.Expression<System.Func<TView, TControl>> controlName, System.IObservable<TParam> withParameter, string? toEvent = null)
public static ReactiveUI.IReactiveBinding<TView, TProp> BindCommand<TView, TViewModel, TProp, TControl, TParam>(this TView view, TViewModel? viewModel, System.Linq.Expressions.Expression<System.Func<TViewModel, TProp?>> propertyName, System.Linq.Expressions.Expression<System.Func<TView, TControl>> controlName, System.IObservable<TParam?> withParameter, string? toEvent = null)
where TView : class, ReactiveUI.IViewFor<TViewModel>
where TViewModel : class
where TProp : System.Windows.Input.ICommand { }
public static ReactiveUI.IReactiveBinding<TView, TProp> BindCommand<TView, TViewModel, TProp, TControl, TParam>(this TView view, TViewModel? viewModel, System.Linq.Expressions.Expression<System.Func<TViewModel, TProp?>> propertyName, System.Linq.Expressions.Expression<System.Func<TView, TControl>> controlName, System.Linq.Expressions.Expression<System.Func<TViewModel, TParam>> withParameter, string? toEvent = null)
public static ReactiveUI.IReactiveBinding<TView, TProp> BindCommand<TView, TViewModel, TProp, TControl, TParam>(this TView view, TViewModel? viewModel, System.Linq.Expressions.Expression<System.Func<TViewModel, TProp?>> propertyName, System.Linq.Expressions.Expression<System.Func<TView, TControl>> controlName, System.Linq.Expressions.Expression<System.Func<TViewModel, TParam?>> withParameter, string? toEvent = null)
where TView : class, ReactiveUI.IViewFor<TViewModel>
where TViewModel : class
where TProp : System.Windows.Input.ICommand { }
}
public class CommandBinderImplementation : Splat.IEnableLogger
{
public CommandBinderImplementation() { }
public ReactiveUI.IReactiveBinding<TView, TProp> BindCommand<TView, TViewModel, TProp, TControl, TParam>(TViewModel? viewModel, TView view, System.Linq.Expressions.Expression<System.Func<TViewModel, TProp?>> vmProperty, System.Linq.Expressions.Expression<System.Func<TView, TControl>> controlProperty, System.Func<TParam> withParameter, string? toEvent = null)
public ReactiveUI.IReactiveBinding<TView, TProp> BindCommand<TView, TViewModel, TProp, TControl, TParam>(TViewModel? viewModel, TView view, System.Linq.Expressions.Expression<System.Func<TViewModel, TProp?>> vmProperty, System.Linq.Expressions.Expression<System.Func<TView, TControl>> controlProperty, System.IObservable<TParam?> withParameter, string? toEvent = null)
where TView : class, ReactiveUI.IViewFor<TViewModel>
where TViewModel : class
where TProp : System.Windows.Input.ICommand { }
public ReactiveUI.IReactiveBinding<TView, TProp> BindCommand<TView, TViewModel, TProp, TControl, TParam>(TViewModel? viewModel, TView view, System.Linq.Expressions.Expression<System.Func<TViewModel, TProp?>> vmProperty, System.Linq.Expressions.Expression<System.Func<TView, TControl>> controlProperty, System.IObservable<TParam> withParameter, string? toEvent = null)
public ReactiveUI.IReactiveBinding<TView, TProp> BindCommand<TView, TViewModel, TProp, TControl, TParam>(TViewModel? viewModel, TView view, System.Linq.Expressions.Expression<System.Func<TViewModel, TProp?>> vmProperty, System.Linq.Expressions.Expression<System.Func<TView, TControl>> controlProperty, System.Linq.Expressions.Expression<System.Func<TViewModel, TParam?>> withParameter, string? toEvent = null)
where TView : class, ReactiveUI.IViewFor<TViewModel>
where TViewModel : class
where TProp : System.Windows.Input.ICommand { }
Expand Down Expand Up @@ -424,6 +424,10 @@ namespace ReactiveUI
public void Dispose() { }
public static ReactiveUI.ObservableAsPropertyHelper<T> Default(T? initialValue = default, System.Reactive.Concurrency.IScheduler? scheduler = null) { }
}
public static class ObservableFuncMixins
{
public static System.IObservable<TResult?> ToObservable<TSource, TResult>(this TSource? source, System.Linq.Expressions.Expression<System.Func<TSource, TResult?>> expression, bool beforeChange = false, bool skipInitial = false) { }
}
public static class ObservableLoggingMixin
{
public static System.IObservable<T> Log<T, TObj>(this System.IObservable<T> @this, TObj logObject, string? message = null, System.Func<T, string>? stringifier = null)
Expand Down
2 changes: 0 additions & 2 deletions src/ReactiveUI.Tests/Locator/DefaultViewLocatorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public void TheRuntimeTypeOfTheViewModelIsUsedToResolveTheView()
/// Tests that the view model to view naming convention can be customized.
/// </summary>
[Fact]
[SuppressMessage("Globalization", "CA1307:Specify StringComparison", Justification = "Not in all platforms.")]
public void ViewModelToViewNamingConventionCanBeCustomized()
{
var resolver = new ModernDependencyResolver();
Expand Down Expand Up @@ -382,7 +381,6 @@ public void CanResolveViewFromViewModelWithIRoutableViewModelType()
/// Tests that make sure this instance [can override name resolution function].
/// </summary>
[Fact]
[SuppressMessage("Globalization", "CA1307:Specify StringComparison", Justification = "Not in all frameworks.")]
public void CanOverrideNameResolutionFunc()
{
var resolver = new ModernDependencyResolver();
Expand Down
1 change: 0 additions & 1 deletion src/ReactiveUI.Tests/Locator/Mocks/IBarViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ namespace ReactiveUI.Tests
/// <summary>
/// A mock interface view model.
/// </summary>
[SuppressMessage("Design", "CA1040: Avoid empty interfaces", Justification = "Deliberate empty interface.")]
public interface IBarViewModel
{
}
Expand Down
1 change: 0 additions & 1 deletion src/ReactiveUI.Tests/Locator/Mocks/IFooViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ namespace ReactiveUI.Tests
/// <summary>
/// A interface view model.
/// </summary>
[SuppressMessage("Design", "CA1040: Avoid empty interfaces", Justification = "Deliberate empty interface.")]
public interface IFooViewModel
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ namespace ReactiveUI.Tests
/// <summary>
/// A strange interface.
/// </summary>
[SuppressMessage("Design", "CA1040: Avoid empty interfaces", Justification = "Deliberate empty interface.")]
public interface IStrangeInterfaceNotFollowingConvention
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// See the LICENSE file in the project root for full license information.

using System.Diagnostics.CodeAnalysis;
using System.Reactive.Linq;

namespace ReactiveUI.Tests
{
Expand All @@ -17,11 +18,28 @@ internal class OAPHIndexerTestFixture : ReactiveObject
/// <summary>
/// Initializes a new instance of the <see cref="OAPHIndexerTestFixture"/> class.
/// </summary>
public OAPHIndexerTestFixture()
public OAPHIndexerTestFixture(int test)
{
var temp = this.WhenAnyValue(f => f.Text)
.ToProperty(this, f => f["Whatever"])
.Value;
switch (test)
{
case 0:
var temp = this.WhenAnyValue(f => f.Text)
.ToProperty(this, f => f["Whatever"])
.Value;
break;

case 1:
var temp1 = this.WhenAnyValue(f => f.Text)
.ToProperty(new ReactiveObject(), f => f.ToString())
.Value;
break;

case 2:
var temp2 = Observable.Return("happy")
.ToProperty(this, string.Empty)
.Value;
break;
}
}

/// <summary>
Expand All @@ -38,7 +56,8 @@ public string? Text
/// </summary>
/// <param name="propertyName">Name of the property.</param>
/// <returns>The string.</returns>
[SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Used by test.")]
#pragma warning disable RCS1163 // Unused parameter.
public string? this[string propertyName] => string.Empty;
#pragma warning restore RCS1163 // Unused parameter.
}
}
Loading