-
-
-
- Geoffrey Huntley
- Sydney, Australia
-
Glenn Watson
- Washington, USA
+ Melbourne, Australia
@@ -339,6 +333,12 @@ The following have been core team members in the past.
+
+
+
+ Geoffrey Huntley
+ Sydney, Australia
+
diff --git a/build.cake b/build.cake
index 0c0e13e2fb..f5c7106f7e 100644
--- a/build.cake
+++ b/build.cake
@@ -24,6 +24,7 @@ var packageWhitelist = new List
MakeAbsolute(File("./src/ReactiveUI.Fody.Helpers/ReactiveUI.Fody.Helpers.csproj")),
MakeAbsolute(File("./src/ReactiveUI.AndroidSupport/ReactiveUI.AndroidSupport.csproj")),
MakeAbsolute(File("./src/ReactiveUI.XamForms/ReactiveUI.XamForms.csproj")),
+ MakeAbsolute(File("./src/ReactiveUI.Uno/ReactiveUI.Uno.csproj")),
};
if (IsRunningOnWindows())
diff --git a/src/Directory.build.props b/src/Directory.build.props
index 9d798df9df..68f49d8479 100644
--- a/src/Directory.build.props
+++ b/src/Directory.build.props
@@ -41,14 +41,14 @@
-
+
-
+
@@ -56,7 +56,7 @@
-
+
@@ -74,7 +74,7 @@
-
+
diff --git a/src/ReactiveUI.AndroidSupport/ControlFetcherMixin.cs b/src/ReactiveUI.AndroidSupport/ControlFetcherMixin.cs
index b7da77fa45..467aea0766 100644
--- a/src/ReactiveUI.AndroidSupport/ControlFetcherMixin.cs
+++ b/src/ReactiveUI.AndroidSupport/ControlFetcherMixin.cs
@@ -26,6 +26,11 @@ public static class ControlFetcherMixin
/// The resolve members.
public static void WireUpControls(this Fragment fragment, View inflatedView, ResolveStrategy resolveMembers = ResolveStrategy.Implicit)
{
+ if (fragment == null)
+ {
+ throw new ArgumentNullException(nameof(fragment));
+ }
+
var members = fragment.GetWireUpMembers(resolveMembers);
foreach (var member in members)
diff --git a/src/ReactiveUI.AndroidSupport/ReactivePagerAdapter.cs b/src/ReactiveUI.AndroidSupport/ReactivePagerAdapter.cs
index 39d36cd90d..69a8a6deae 100644
--- a/src/ReactiveUI.AndroidSupport/ReactivePagerAdapter.cs
+++ b/src/ReactiveUI.AndroidSupport/ReactivePagerAdapter.cs
@@ -81,9 +81,23 @@ public override Object InstantiateItem(ViewGroup container, int position)
}
///
- public override void DestroyItem(ViewGroup container, int position, Object @object)
+ public override void DestroyItem(ViewGroup container, int position, Object item)
{
- var view = (View)@object;
+ if (container == null)
+ {
+ throw new ArgumentNullException(nameof(container));
+ }
+
+ if (item == null)
+ {
+ throw new ArgumentNullException(nameof(item));
+ }
+
+ if (!(item is View view))
+ {
+ throw new ArgumentException("Item must be of type View", nameof(item));
+ }
+
container.RemoveView(view);
}
diff --git a/src/ReactiveUI.AndroidSupport/ReactiveRecyclerViewAdapter.cs b/src/ReactiveUI.AndroidSupport/ReactiveRecyclerViewAdapter.cs
index f3f237d272..6b2e3b9370 100644
--- a/src/ReactiveUI.AndroidSupport/ReactiveRecyclerViewAdapter.cs
+++ b/src/ReactiveUI.AndroidSupport/ReactiveRecyclerViewAdapter.cs
@@ -73,7 +73,17 @@ public virtual int GetItemViewType(int position, TViewModel viewModel)
///
public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
{
- ((IViewFor)holder).ViewModel = GetViewModelByPosition(position);
+ if (holder == null)
+ {
+ throw new ArgumentNullException(nameof(holder));
+ }
+
+ if (!(holder is IViewFor viewForHolder))
+ {
+ throw new ArgumentException("Holder must be derived from IViewFor", nameof(holder));
+ }
+
+ viewForHolder.ViewModel = GetViewModelByPosition(position);
}
///
diff --git a/src/ReactiveUI.AndroidSupport/ReactiveUI.AndroidSupport.csproj b/src/ReactiveUI.AndroidSupport/ReactiveUI.AndroidSupport.csproj
index 170652a6c5..0a91757270 100644
--- a/src/ReactiveUI.AndroidSupport/ReactiveUI.AndroidSupport.csproj
+++ b/src/ReactiveUI.AndroidSupport/ReactiveUI.AndroidSupport.csproj
@@ -4,6 +4,7 @@
MonoAndroid81
ReactiveUI extensions for the Android Support Library
ReactiveUI.AndroidSupport
+ latest
diff --git a/src/ReactiveUI.Blend/FollowObservableStateBehavior.cs b/src/ReactiveUI.Blend/FollowObservableStateBehavior.cs
index 940ef27625..7c7a82e5f9 100644
--- a/src/ReactiveUI.Blend/FollowObservableStateBehavior.cs
+++ b/src/ReactiveUI.Blend/FollowObservableStateBehavior.cs
@@ -89,17 +89,26 @@ public FrameworkElement TargetObject
/// The instance containing the event data.
protected static void OnStateObservableChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
{
- var @this = (FollowObservableStateBehavior)sender;
- if (@this._watcher != null)
+ if (e == null)
{
- @this._watcher.Dispose();
- @this._watcher = null;
+ throw new ArgumentNullException(nameof(e));
}
- @this._watcher = ((IObservable)e.NewValue).ObserveOn(RxApp.MainThreadScheduler).Subscribe(
+ if (!(sender is FollowObservableStateBehavior item))
+ {
+ throw new ArgumentException("Sender must be of type " + nameof(FollowObservableStateBehavior), nameof(sender));
+ }
+
+ if (item._watcher != null)
+ {
+ item._watcher.Dispose();
+ item._watcher = null;
+ }
+
+ item._watcher = ((IObservable)e.NewValue).ObserveOn(RxApp.MainThreadScheduler).Subscribe(
x =>
{
- var target = @this.TargetObject ?? @this.AssociatedObject;
+ var target = item.TargetObject ?? item.AssociatedObject;
#if NETFX_CORE
VisualStateManager.GoToState(target, x, true);
#else
@@ -115,12 +124,12 @@ protected static void OnStateObservableChanged(DependencyObject sender, Dependen
},
ex =>
{
- if (!@this.AutoResubscribeOnError)
+ if (!item.AutoResubscribeOnError)
{
return;
}
- OnStateObservableChanged(@this, e);
+ OnStateObservableChanged(item, e);
});
}
diff --git a/src/ReactiveUI.Blend/Platforms/net461/ObservableTrigger.cs b/src/ReactiveUI.Blend/Platforms/net461/ObservableTrigger.cs
index 13fdcc6dec..bc03e7d8a7 100644
--- a/src/ReactiveUI.Blend/Platforms/net461/ObservableTrigger.cs
+++ b/src/ReactiveUI.Blend/Platforms/net461/ObservableTrigger.cs
@@ -47,7 +47,11 @@ public IObservable Observable
/// The instance containing the event data.
protected static void OnObservableChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
{
- ObservableTrigger triggerItem = (ObservableTrigger)sender;
+ if (!(sender is ObservableTrigger triggerItem))
+ {
+ throw new ArgumentException("Sender must be of type " + nameof(ObservableTrigger), nameof(sender));
+ }
+
if (triggerItem._watcher != null)
{
triggerItem._watcher.Dispose();
diff --git a/src/ReactiveUI.Blend/ReactiveUI.Blend.csproj b/src/ReactiveUI.Blend/ReactiveUI.Blend.csproj
index 57b3e7f55f..08003a6b1e 100644
--- a/src/ReactiveUI.Blend/ReactiveUI.Blend.csproj
+++ b/src/ReactiveUI.Blend/ReactiveUI.Blend.csproj
@@ -6,6 +6,7 @@
ReactiveUI.Blend
Blend behaviors for ReactiveUI
ReactiveUI.Blend
+ latest
diff --git a/src/ReactiveUI.Fody.Helpers/ObservableAsPropertyExtensions.cs b/src/ReactiveUI.Fody.Helpers/ObservableAsPropertyExtensions.cs
index 5000a31687..b85596a9e7 100644
--- a/src/ReactiveUI.Fody.Helpers/ObservableAsPropertyExtensions.cs
+++ b/src/ReactiveUI.Fody.Helpers/ObservableAsPropertyExtensions.cs
@@ -20,7 +20,7 @@ public static class ObservableAsPropertyExtensions
///
/// The type of the object.
/// The type of the ret.
- /// The this.
+ /// The observable with the return value.
/// The source.
/// The property.
/// The initial value.
@@ -32,10 +32,20 @@ public static class ObservableAsPropertyExtensions
/// or
/// Backing field not found for " + propertyInfo.
///
- public static ObservableAsPropertyHelper ToPropertyEx(this IObservable @this, TObj source, Expression> property, TRet initialValue = default(TRet), bool deferSubscription = false, IScheduler scheduler = null)
+ public static ObservableAsPropertyHelper ToPropertyEx(this IObservable item, TObj source, Expression> property, TRet initialValue = default, bool deferSubscription = false, IScheduler scheduler = null)
where TObj : ReactiveObject
{
- var result = @this.ToProperty(source, property, initialValue, deferSubscription, scheduler);
+ if (item == null)
+ {
+ throw new ArgumentNullException(nameof(item));
+ }
+
+ if (property == null)
+ {
+ throw new ArgumentNullException(nameof(property));
+ }
+
+ var result = item.ToProperty(source, property, initialValue, deferSubscription, scheduler);
// Now assign the field via reflection.
var propertyInfo = property.GetPropertyInfo();
diff --git a/src/ReactiveUI.Fody.Helpers/ReactiveUI.Fody.Helpers.csproj b/src/ReactiveUI.Fody.Helpers/ReactiveUI.Fody.Helpers.csproj
index dda795dc48..5812e6a7bf 100644
--- a/src/ReactiveUI.Fody.Helpers/ReactiveUI.Fody.Helpers.csproj
+++ b/src/ReactiveUI.Fody.Helpers/ReactiveUI.Fody.Helpers.csproj
@@ -11,11 +11,12 @@
false
+ latest
-
-
+
+
diff --git a/src/ReactiveUI.Fody.Tests/API/ApiApprovalTests.ReactiveUIFody.net461.approved.txt b/src/ReactiveUI.Fody.Tests/API/ApiApprovalTests.ReactiveUIFody.net461.approved.txt
index 4f772e7c29..540a1203c9 100644
--- a/src/ReactiveUI.Fody.Tests/API/ApiApprovalTests.ReactiveUIFody.net461.approved.txt
+++ b/src/ReactiveUI.Fody.Tests/API/ApiApprovalTests.ReactiveUIFody.net461.approved.txt
@@ -13,7 +13,7 @@ namespace ReactiveUI.Fody.Helpers
}
public class static ObservableAsPropertyExtensions
{
- public static ReactiveUI.ObservableAsPropertyHelper ToPropertyEx(this System.IObservable @this, TObj source, System.Linq.Expressions.Expression> property, TRet initialValue = null, bool deferSubscription = False, System.Reactive.Concurrency.IScheduler scheduler = null)
+ public static ReactiveUI.ObservableAsPropertyHelper ToPropertyEx(this System.IObservable item, TObj source, System.Linq.Expressions.Expression> property, TRet initialValue = null, bool deferSubscription = False, System.Reactive.Concurrency.IScheduler scheduler = null)
where TObj : ReactiveUI.ReactiveObject { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Property | System.AttributeTargets.All)]
diff --git a/src/ReactiveUI.Fody.Tests/API/ApiApprovalTests.ReactiveUIFody.netcoreapp2.0.approved.txt b/src/ReactiveUI.Fody.Tests/API/ApiApprovalTests.ReactiveUIFody.netcoreapp2.0.approved.txt
index 4c792d9add..5dd4c8e08c 100644
--- a/src/ReactiveUI.Fody.Tests/API/ApiApprovalTests.ReactiveUIFody.netcoreapp2.0.approved.txt
+++ b/src/ReactiveUI.Fody.Tests/API/ApiApprovalTests.ReactiveUIFody.netcoreapp2.0.approved.txt
@@ -13,7 +13,7 @@ namespace ReactiveUI.Fody.Helpers
}
public class static ObservableAsPropertyExtensions
{
- public static ReactiveUI.ObservableAsPropertyHelper ToPropertyEx(this System.IObservable @this, TObj source, System.Linq.Expressions.Expression> property, TRet initialValue = null, bool deferSubscription = False, System.Reactive.Concurrency.IScheduler scheduler = null)
+ public static ReactiveUI.ObservableAsPropertyHelper ToPropertyEx(this System.IObservable item, TObj source, System.Linq.Expressions.Expression> property, TRet initialValue = null, bool deferSubscription = False, System.Reactive.Concurrency.IScheduler scheduler = null)
where TObj : ReactiveUI.ReactiveObject { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Property | System.AttributeTargets.All)]
diff --git a/src/ReactiveUI.Fody.Tests/ReactiveUI.Fody.Tests.csproj b/src/ReactiveUI.Fody.Tests/ReactiveUI.Fody.Tests.csproj
index 60b5891d24..981ea9b798 100644
--- a/src/ReactiveUI.Fody.Tests/ReactiveUI.Fody.Tests.csproj
+++ b/src/ReactiveUI.Fody.Tests/ReactiveUI.Fody.Tests.csproj
@@ -4,6 +4,7 @@
$(TargetFrameworks);net461
netstandard2.0
$(TargetFramework)
+ latest
diff --git a/src/ReactiveUI.Fody/CecilExtensions.cs b/src/ReactiveUI.Fody/CecilExtensions.cs
index e7f9b0f57b..e507923e4a 100644
--- a/src/ReactiveUI.Fody/CecilExtensions.cs
+++ b/src/ReactiveUI.Fody/CecilExtensions.cs
@@ -23,6 +23,16 @@ public static class CecilExtensions
/// The il.
public static void Emit(this MethodBody body, Action il)
{
+ if (body == null)
+ {
+ throw new ArgumentNullException(nameof(body));
+ }
+
+ if (il == null)
+ {
+ throw new ArgumentNullException(nameof(il));
+ }
+
il(body.GetILProcessor());
}
@@ -34,6 +44,11 @@ public static void Emit(this MethodBody body, Action il)
/// A generic method with generic typed arguments.
public static GenericInstanceMethod MakeGenericMethod(this MethodReference method, params TypeReference[] genericArguments)
{
+ if (genericArguments == null)
+ {
+ throw new ArgumentNullException(nameof(genericArguments));
+ }
+
var result = new GenericInstanceMethod(method);
foreach (var argument in genericArguments)
{
@@ -54,6 +69,16 @@ public static GenericInstanceMethod MakeGenericMethod(this MethodReference metho
///
public static bool IsAssignableFrom(this TypeReference baseType, TypeReference type, Action logger = null)
{
+ if (baseType == null)
+ {
+ throw new ArgumentNullException(nameof(baseType));
+ }
+
+ if (type == null)
+ {
+ throw new ArgumentNullException(nameof(type));
+ }
+
return baseType.Resolve().IsAssignableFrom(type.Resolve(), logger);
}
@@ -107,6 +132,11 @@ public static bool IsAssignableFrom(this TypeDefinition baseType, TypeDefinition
///
public static bool IsDefined(this IMemberDefinition member, TypeReference attributeType)
{
+ if (member == null)
+ {
+ throw new ArgumentNullException(nameof(member));
+ }
+
return member.HasCustomAttributes && member.CustomAttributes.Any(x => x.AttributeType.FullName == attributeType.FullName);
}
@@ -118,41 +148,25 @@ public static bool IsDefined(this IMemberDefinition member, TypeReference attrib
/// The method bound to the generic type.
public static MethodReference Bind(this MethodReference method, GenericInstanceType genericType)
{
- var reference = new MethodReference(method.Name, method.ReturnType, genericType);
- reference.HasThis = method.HasThis;
- reference.ExplicitThis = method.ExplicitThis;
- reference.CallingConvention = method.CallingConvention;
-
- foreach (var parameter in method.Parameters)
+ if (method == null)
{
- reference.Parameters.Add(new ParameterDefinition(parameter.ParameterType));
+ throw new ArgumentNullException(nameof(method));
}
- return reference;
- }
-
- /*
- public static MethodReference BindDefinition(this MethodReference method, TypeReference genericTypeDefinition)
- {
- if (!genericTypeDefinition.HasGenericParameters)
- return method;
-
- var genericDeclaration = new GenericInstanceType(genericTypeDefinition);
- foreach (var parameter in genericTypeDefinition.GenericParameters)
- {
- genericDeclaration.GenericArguments.Add(parameter);
- }
- var reference = new MethodReference(method.Name, method.ReturnType, genericDeclaration);
- reference.HasThis = method.HasThis;
- reference.ExplicitThis = method.ExplicitThis;
- reference.CallingConvention = method.CallingConvention;
+ var reference = new MethodReference(method.Name, method.ReturnType, genericType)
+ {
+ HasThis = method.HasThis,
+ ExplicitThis = method.ExplicitThis,
+ CallingConvention = method.CallingConvention
+ };
foreach (var parameter in method.Parameters)
+ {
reference.Parameters.Add(new ParameterDefinition(parameter.ParameterType));
+ }
return reference;
}
- */
///
/// Binds the generic type definition to a field.
@@ -162,6 +176,16 @@ public static MethodReference BindDefinition(this MethodReference method, TypeRe
/// The field bound to the generic type.
public static FieldReference BindDefinition(this FieldReference field, TypeReference genericTypeDefinition)
{
+ if (field == null)
+ {
+ throw new ArgumentNullException(nameof(field));
+ }
+
+ if (genericTypeDefinition == null)
+ {
+ throw new ArgumentNullException(nameof(genericTypeDefinition));
+ }
+
if (!genericTypeDefinition.HasGenericParameters)
{
return field;
@@ -185,6 +209,11 @@ public static FieldReference BindDefinition(this FieldReference field, TypeRefer
/// The assembly if found, null if not.
public static AssemblyNameReference FindAssembly(this ModuleDefinition currentModule, string assemblyName)
{
+ if (currentModule == null)
+ {
+ throw new ArgumentNullException(nameof(currentModule));
+ }
+
return currentModule.AssemblyReferences.SingleOrDefault(x => x.Name == assemblyName);
}
@@ -199,6 +228,11 @@ public static AssemblyNameReference FindAssembly(this ModuleDefinition currentMo
/// The type reference.
public static TypeReference FindType(this ModuleDefinition currentModule, string @namespace, string typeName, IMetadataScope scope = null, params string[] typeParameters)
{
+ if (typeParameters == null)
+ {
+ throw new ArgumentNullException(nameof(typeParameters));
+ }
+
var result = new TypeReference(@namespace, typeName, currentModule, scope);
foreach (var typeParameter in typeParameters)
{
@@ -216,28 +250,17 @@ public static TypeReference FindType(this ModuleDefinition currentModule, string
/// A value indicating the result of the comparison.
public static bool CompareTo(this TypeReference type, TypeReference compareTo)
{
- return type.FullName == compareTo.FullName;
- }
-
-/*
- public static IEnumerable GetAllTypes(this ModuleDefinition module)
- {
- var stack = new Stack();
- foreach (var type in module.Types)
+ if (type == null)
{
- stack.Push(type);
+ throw new ArgumentNullException(nameof(type));
}
- while (stack.Any())
- {
- var current = stack.Pop();
- yield return current;
- foreach (var nestedType in current.NestedTypes)
- {
- stack.Push(nestedType);
- }
+ if (compareTo == null)
+ {
+ throw new ArgumentNullException(nameof(compareTo));
}
+
+ return type.FullName == compareTo.FullName;
}
-*/
}
}
diff --git a/src/ReactiveUI.Fody/ObservableAsPropertyWeaver.cs b/src/ReactiveUI.Fody/ObservableAsPropertyWeaver.cs
index 43b42f2916..0482060df6 100644
--- a/src/ReactiveUI.Fody/ObservableAsPropertyWeaver.cs
+++ b/src/ReactiveUI.Fody/ObservableAsPropertyWeaver.cs
@@ -129,6 +129,16 @@ public void Execute()
/// The type.
public void EmitDefaultValue(MethodBody methodBody, ILProcessor il, TypeReference type)
{
+ if (methodBody == null)
+ {
+ throw new ArgumentNullException(nameof(methodBody));
+ }
+
+ if (il == null)
+ {
+ throw new ArgumentNullException(nameof(il));
+ }
+
if (type.CompareTo(ModuleDefinition.TypeSystem.Boolean) || type.CompareTo(ModuleDefinition.TypeSystem.Byte) ||
type.CompareTo(ModuleDefinition.TypeSystem.Int16) || type.CompareTo(ModuleDefinition.TypeSystem.Int32))
{
diff --git a/src/ReactiveUI.Fody/ReactiveUI.Fody.csproj b/src/ReactiveUI.Fody/ReactiveUI.Fody.csproj
index 6a4dbea8c0..b920db4fd7 100644
--- a/src/ReactiveUI.Fody/ReactiveUI.Fody.csproj
+++ b/src/ReactiveUI.Fody/ReactiveUI.Fody.csproj
@@ -4,9 +4,10 @@
$(TargetFrameworks);net461
Fody Weavers for ReactiveUI.Fody.
False
+ latest
-
+
\ No newline at end of file
diff --git a/src/ReactiveUI.LeakTests/ReactiveUI.LeakTests.csproj b/src/ReactiveUI.LeakTests/ReactiveUI.LeakTests.csproj
index b70f06637b..2661a3dbe2 100644
--- a/src/ReactiveUI.LeakTests/ReactiveUI.LeakTests.csproj
+++ b/src/ReactiveUI.LeakTests/ReactiveUI.LeakTests.csproj
@@ -1,6 +1,7 @@
net461
+ latest
diff --git a/src/ReactiveUI.Splat.Tests/ReactiveUI.Splat.Tests.csproj b/src/ReactiveUI.Splat.Tests/ReactiveUI.Splat.Tests.csproj
index a0d6aed0a5..a9bdd79c4c 100644
--- a/src/ReactiveUI.Splat.Tests/ReactiveUI.Splat.Tests.csproj
+++ b/src/ReactiveUI.Splat.Tests/ReactiveUI.Splat.Tests.csproj
@@ -4,12 +4,13 @@
netcoreapp2.2
false
+ latest
-
-
-
+
+
+
diff --git a/src/ReactiveUI.Testing.Tests/ReactiveUI.Testing.Tests.csproj b/src/ReactiveUI.Testing.Tests/ReactiveUI.Testing.Tests.csproj
index 79162b61fd..30057d031a 100644
--- a/src/ReactiveUI.Testing.Tests/ReactiveUI.Testing.Tests.csproj
+++ b/src/ReactiveUI.Testing.Tests/ReactiveUI.Testing.Tests.csproj
@@ -4,6 +4,7 @@
$(TargetFrameworks);net461
netstandard2.0
$(TargetFramework)
+ latest
diff --git a/src/ReactiveUI.Testing.Tests/TestFixture.cs b/src/ReactiveUI.Testing.Tests/TestFixture.cs
index ab66321b2d..2e67133245 100644
--- a/src/ReactiveUI.Testing.Tests/TestFixture.cs
+++ b/src/ReactiveUI.Testing.Tests/TestFixture.cs
@@ -4,6 +4,7 @@
// See the LICENSE file in the project root for full license information.
using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
namespace ReactiveUI.Testing.Tests
{
@@ -30,6 +31,7 @@ public class TestFixture
///
/// Gets or sets the variables.
///
+ [SuppressMessage("Design", "CA2227: Read only dictionary", Justification = "Used in mock.")]
public Dictionary Variables { get; set; }
}
}
diff --git a/src/ReactiveUI.Testing.Tests/TestFixtureBuilder.cs b/src/ReactiveUI.Testing.Tests/TestFixtureBuilder.cs
index 65e67133e4..b91e86bb6b 100644
--- a/src/ReactiveUI.Testing.Tests/TestFixtureBuilder.cs
+++ b/src/ReactiveUI.Testing.Tests/TestFixtureBuilder.cs
@@ -22,7 +22,14 @@ public class TestFixtureBuilder : IBuilder
///
/// The builder.
/// The test fixture.
- public static implicit operator TestFixture(TestFixtureBuilder builder) => builder.Build();
+ public static implicit operator TestFixture(TestFixtureBuilder builder) => ToTestFixture(builder);
+
+ ///
+ /// Performs conversion from to .
+ ///
+ /// The builder.
+ /// The test fixture.
+ public static TestFixture ToTestFixture(TestFixtureBuilder builder) => builder.Build();
///
/// Adds the count to the builder.
diff --git a/src/ReactiveUI.Testing/IBuilderExtensions.cs b/src/ReactiveUI.Testing/IBuilderExtensions.cs
index a6beb9ff05..3e98c819aa 100644
--- a/src/ReactiveUI.Testing/IBuilderExtensions.cs
+++ b/src/ReactiveUI.Testing/IBuilderExtensions.cs
@@ -51,6 +51,11 @@ public static TBuilder With(
IEnumerable values)
where TBuilder : IBuilder
{
+ if (field == null)
+ {
+ throw new System.ArgumentNullException(nameof(field));
+ }
+
if (values == null)
{
field = null;
@@ -75,6 +80,11 @@ public static TBuilder With(
public static TBuilder With(this TBuilder builder, ref List field, TField value)
where TBuilder : IBuilder
{
+ if (field == null)
+ {
+ throw new System.ArgumentNullException(nameof(field));
+ }
+
field.Add(value);
return builder;
}
@@ -95,6 +105,11 @@ public static TBuilder With(
KeyValuePair keyValuePair)
where TBuilder : IBuilder
{
+ if (dictionary == null)
+ {
+ throw new System.ArgumentNullException(nameof(dictionary));
+ }
+
dictionary.Add(keyValuePair.Key, keyValuePair.Value);
return builder;
}
@@ -117,6 +132,11 @@ public static TBuilder With(
TField value)
where TBuilder : IBuilder
{
+ if (dictionary == null)
+ {
+ throw new System.ArgumentNullException(nameof(dictionary));
+ }
+
dictionary.Add(key, value);
return builder;
}
@@ -136,6 +156,11 @@ public static TBuilder With(
ref Dictionary dictionary,
IDictionary keyValuePair)
{
+ if (dictionary == null)
+ {
+ throw new System.ArgumentNullException(nameof(dictionary));
+ }
+
dictionary = (Dictionary)keyValuePair;
return builder;
}
diff --git a/src/ReactiveUI.Testing/MessageBusExtensions.cs b/src/ReactiveUI.Testing/MessageBusExtensions.cs
index 5f9614d548..64ef6f1fc1 100644
--- a/src/ReactiveUI.Testing/MessageBusExtensions.cs
+++ b/src/ReactiveUI.Testing/MessageBusExtensions.cs
@@ -25,6 +25,11 @@ public static class MessageBusExtensions
/// The return value of the function.
public static TRet With(this IMessageBus messageBus, Func block)
{
+ if (block == null)
+ {
+ throw new ArgumentNullException(nameof(block));
+ }
+
using (messageBus.WithMessageBus())
{
return block();
@@ -60,6 +65,11 @@ public static IDisposable WithMessageBus(this IMessageBus messageBus)
/// The action to execute.
public static void With(this IMessageBus messageBus, Action block)
{
+ if (block == null)
+ {
+ throw new ArgumentNullException(nameof(block));
+ }
+
using (messageBus.WithMessageBus())
{
block();
diff --git a/src/ReactiveUI.Testing/ReactiveUI.Testing.csproj b/src/ReactiveUI.Testing/ReactiveUI.Testing.csproj
index c5d3abf429..5ed54f732a 100644
--- a/src/ReactiveUI.Testing/ReactiveUI.Testing.csproj
+++ b/src/ReactiveUI.Testing/ReactiveUI.Testing.csproj
@@ -6,6 +6,7 @@
ReactiveUI.Testing
A library to aid in writing unit tests for ReactiveUI projects
ReactiveUI.Testing
+ latest
diff --git a/src/ReactiveUI.Testing/SchedulerExtensions.cs b/src/ReactiveUI.Testing/SchedulerExtensions.cs
index 404423076f..7f88119182 100644
--- a/src/ReactiveUI.Testing/SchedulerExtensions.cs
+++ b/src/ReactiveUI.Testing/SchedulerExtensions.cs
@@ -60,6 +60,11 @@ public static IDisposable WithScheduler(IScheduler sched)
public static TRet With(this T sched, Func block)
where T : IScheduler
{
+ if (block == null)
+ {
+ throw new ArgumentNullException(nameof(block));
+ }
+
TRet ret;
using (WithScheduler(sched))
{
@@ -83,6 +88,11 @@ public static TRet With(this T sched, Func block)
public static async Task WithAsync(this T sched, Func> block)
where T : IScheduler
{
+ if (block == null)
+ {
+ throw new ArgumentNullException(nameof(block));
+ }
+
TRet ret;
using (WithScheduler(sched))
{
@@ -137,6 +147,11 @@ public static Task WithAsync(this T sched, Func block)
/// incremental, it sets the time.
public static void AdvanceToMs(this TestScheduler sched, double milliseconds)
{
+ if (sched == null)
+ {
+ throw new ArgumentNullException(nameof(sched));
+ }
+
sched.AdvanceTo(sched.FromTimeSpan(TimeSpan.FromMilliseconds(milliseconds)));
}
@@ -149,6 +164,11 @@ public static void AdvanceToMs(this TestScheduler sched, double milliseconds)
/// by, in milliseconds.
public static void AdvanceByMs(this TestScheduler sched, double milliseconds)
{
+ if (sched == null)
+ {
+ throw new ArgumentNullException(nameof(sched));
+ }
+
sched.AdvanceBy(sched.FromTimeSpan(TimeSpan.FromMilliseconds(milliseconds)));
}
diff --git a/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.net461.approved.txt b/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.net461.approved.txt
index 6b7eb626dc..b671259841 100644
--- a/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.net461.approved.txt
+++ b/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.net461.approved.txt
@@ -1,5 +1,6 @@
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("ReactiveUI.AndroidSupport")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("ReactiveUI.Tests")]
+[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("ReactiveUI.Uno")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("ReactiveUI.Winforms")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("ReactiveUI.Wpf")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("ReactiveUI.XamForms")]
@@ -394,9 +395,9 @@ namespace ReactiveUI
}
public class static ObservedChangedMixin
{
- public static string GetPropertyName(this ReactiveUI.IObservedChange @this) { }
- public static TValue GetValue(this ReactiveUI.IObservedChange @this) { }
- public static System.IObservable Value(this System.IObservable> @this) { }
+ public static string GetPropertyName(this ReactiveUI.IObservedChange item) { }
+ public static TValue GetValue(this ReactiveUI.IObservedChange item) { }
+ public static System.IObservable Value(this System.IObservable> item) { }
}
public class static OrderedComparer
{
@@ -503,11 +504,11 @@ namespace ReactiveUI
}
public class static ReactiveCommandMixins
{
- public static System.IDisposable InvokeCommand(this System.IObservable @this, System.Windows.Input.ICommand command) { }
- public static System.IDisposable InvokeCommand(this System.IObservable @this, ReactiveUI.ReactiveCommandBase command) { }
- public static System.IDisposable InvokeCommand(this System.IObservable @this, TTarget target, System.Linq.Expressions.Expression> commandProperty)
+ public static System.IDisposable InvokeCommand(this System.IObservable item, System.Windows.Input.ICommand command) { }
+ public static System.IDisposable InvokeCommand(this System.IObservable item, ReactiveUI.ReactiveCommandBase command) { }
+ public static System.IDisposable InvokeCommand(this System.IObservable item, TTarget target, System.Linq.Expressions.Expression> commandProperty)
where TTarget : class { }
- public static System.IDisposable InvokeCommand(this System.IObservable @this, TTarget target, System.Linq.Expressions.Expression>> commandProperty)
+ public static System.IDisposable InvokeCommand(this System.IObservable item, TTarget target, System.Linq.Expressions.Expression>> commandProperty)
where TTarget : class { }
}
public class ReactiveCommand : ReactiveUI.ReactiveCommandBase
@@ -522,8 +523,8 @@ namespace ReactiveUI
}
public class static ReactiveNotifyPropertyChangedMixin
{
- public static System.IObservable> ObservableForProperty(this TSender @this, System.Linq.Expressions.Expression> property, bool beforeChange = False, bool skipInitial = True) { }
- public static System.IObservable ObservableForProperty(this TSender @this, System.Linq.Expressions.Expression> property, System.Func selector, bool beforeChange = False)
+ public static System.IObservable> ObservableForProperty(this TSender item, System.Linq.Expressions.Expression> property, bool beforeChange = False, bool skipInitial = True) { }
+ public static System.IObservable ObservableForProperty(this TSender item, System.Linq.Expressions.Expression> property, System.Func selector, bool beforeChange = False)
where TSender : class { }
public static System.IObservable> SubscribeToExpressionChain(this TSender source, System.Linq.Expressions.Expression expression, bool beforeChange = False, bool skipInitial = True, bool suppressWarnings = False) { }
}
@@ -561,7 +562,7 @@ namespace ReactiveUI
public static System.Func GetValueFetcherOrThrow(System.Reflection.MemberInfo member) { }
public static System.Action GetValueSetterForProperty(System.Reflection.MemberInfo member) { }
public static System.Action GetValueSetterOrThrow(System.Reflection.MemberInfo member) { }
- public static bool IsStatic(this System.Reflection.PropertyInfo @this) { }
+ public static bool IsStatic(this System.Reflection.PropertyInfo item) { }
public static System.Type ReallyFindType(string type, bool throwOnFailure) { }
public static System.Linq.Expressions.Expression Rewrite(System.Linq.Expressions.Expression expression) { }
public static void ThrowIfMethodsNotOverloaded(string callingTypeName, object targetObject, params string[] methodsToCheck) { }
@@ -576,9 +577,9 @@ namespace ReactiveUI
}
public class static RoutableViewModelMixin
{
- public static System.IDisposable WhenNavigatedTo(this ReactiveUI.IRoutableViewModel @this, System.Func onNavigatedTo) { }
- public static System.IObservable WhenNavigatedToObservable(this ReactiveUI.IRoutableViewModel @this) { }
- public static System.IObservable WhenNavigatingFromObservable(this ReactiveUI.IRoutableViewModel @this) { }
+ public static System.IDisposable WhenNavigatedTo(this ReactiveUI.IRoutableViewModel item, System.Func onNavigatedTo) { }
+ public static System.IObservable WhenNavigatedToObservable(this ReactiveUI.IRoutableViewModel item) { }
+ public static System.IObservable WhenNavigatingFromObservable(this ReactiveUI.IRoutableViewModel item) { }
}
[System.Runtime.Serialization.DataContractAttribute()]
public class RoutingState : ReactiveUI.ReactiveObject
@@ -602,9 +603,9 @@ namespace ReactiveUI
}
public class static RoutingStateMixins
{
- public static T FindViewModelInStack(this ReactiveUI.RoutingState @this)
+ public static T FindViewModelInStack(this ReactiveUI.RoutingState item)
where T : ReactiveUI.IRoutableViewModel { }
- public static ReactiveUI.IRoutableViewModel GetCurrentViewModel(this ReactiveUI.RoutingState @this) { }
+ public static ReactiveUI.IRoutableViewModel GetCurrentViewModel(this ReactiveUI.RoutingState item) { }
}
public class static RxApp
{
@@ -640,10 +641,10 @@ namespace ReactiveUI
}
public class static SuspensionHostExtensions
{
- public static T GetAppState(this ReactiveUI.ISuspensionHost @this) { }
- public static System.IObservable ObserveAppState(this ReactiveUI.ISuspensionHost @this)
+ public static T GetAppState(this ReactiveUI.ISuspensionHost item) { }
+ public static System.IObservable ObserveAppState(this ReactiveUI.ISuspensionHost item)
where T : class { }
- public static System.IDisposable SetupDefaultSuspendResume(this ReactiveUI.ISuspensionHost @this, ReactiveUI.ISuspensionDriver driver = null) { }
+ public static System.IDisposable SetupDefaultSuspendResume(this ReactiveUI.ISuspensionHost item, ReactiveUI.ISuspensionDriver driver = null) { }
}
public class UnhandledErrorException : System.Exception
{
@@ -671,14 +672,14 @@ namespace ReactiveUI
}
public class static ViewForMixins
{
- public static void WhenActivated(this ReactiveUI.ISupportsActivation @this, System.Func> block) { }
- public static void WhenActivated(this ReactiveUI.ISupportsActivation @this, System.Action> block) { }
- public static void WhenActivated(this ReactiveUI.ISupportsActivation @this, System.Action block) { }
- public static System.IDisposable WhenActivated(this ReactiveUI.IActivatable @this, System.Func> block) { }
- public static System.IDisposable WhenActivated(this ReactiveUI.IActivatable @this, System.Func> block, ReactiveUI.IViewFor view) { }
- public static System.IDisposable WhenActivated(this ReactiveUI.IActivatable @this, System.Action> block) { }
- public static System.IDisposable WhenActivated(this ReactiveUI.IActivatable @this, System.Action> block, ReactiveUI.IViewFor view) { }
- public static System.IDisposable WhenActivated(this ReactiveUI.IActivatable @this, System.Action block, ReactiveUI.IViewFor view = null) { }
+ public static void WhenActivated(this ReactiveUI.ISupportsActivation item, System.Func> block) { }
+ public static void WhenActivated(this ReactiveUI.ISupportsActivation item, System.Action> block) { }
+ public static void WhenActivated(this ReactiveUI.ISupportsActivation item, System.Action block) { }
+ public static System.IDisposable WhenActivated(this ReactiveUI.IActivatable item, System.Func> block) { }
+ public static System.IDisposable WhenActivated(this ReactiveUI.IActivatable item, System.Func> block, ReactiveUI.IViewFor view) { }
+ public static System.IDisposable WhenActivated(this ReactiveUI.IActivatable item, System.Action> block) { }
+ public static System.IDisposable WhenActivated(this ReactiveUI.IActivatable item, System.Action> block, ReactiveUI.IViewFor view) { }
+ public static System.IDisposable WhenActivated(this ReactiveUI.IActivatable item, System.Action block, ReactiveUI.IViewFor view = null) { }
}
public class static ViewLocator
{
diff --git a/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.netcoreapp2.0.approved.txt b/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.netcoreapp2.0.approved.txt
index 26820301a8..b25be35e00 100644
--- a/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.netcoreapp2.0.approved.txt
+++ b/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.netcoreapp2.0.approved.txt
@@ -1,5 +1,6 @@
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("ReactiveUI.AndroidSupport")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("ReactiveUI.Tests")]
+[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("ReactiveUI.Uno")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("ReactiveUI.Winforms")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("ReactiveUI.Wpf")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("ReactiveUI.XamForms")]
@@ -388,9 +389,9 @@ namespace ReactiveUI
}
public class static ObservedChangedMixin
{
- public static string GetPropertyName(this ReactiveUI.IObservedChange @this) { }
- public static TValue GetValue(this ReactiveUI.IObservedChange @this) { }
- public static System.IObservable Value(this System.IObservable> @this) { }
+ public static string GetPropertyName(this ReactiveUI.IObservedChange item) { }
+ public static TValue GetValue(this ReactiveUI.IObservedChange item) { }
+ public static System.IObservable Value(this System.IObservable> item) { }
}
public class static OrderedComparer
{
@@ -497,11 +498,11 @@ namespace ReactiveUI
}
public class static ReactiveCommandMixins
{
- public static System.IDisposable InvokeCommand(this System.IObservable @this, System.Windows.Input.ICommand command) { }
- public static System.IDisposable InvokeCommand(this System.IObservable @this, ReactiveUI.ReactiveCommandBase command) { }
- public static System.IDisposable InvokeCommand(this System.IObservable @this, TTarget target, System.Linq.Expressions.Expression> commandProperty)
+ public static System.IDisposable InvokeCommand(this System.IObservable item, System.Windows.Input.ICommand command) { }
+ public static System.IDisposable InvokeCommand(this System.IObservable item, ReactiveUI.ReactiveCommandBase command) { }
+ public static System.IDisposable InvokeCommand(this System.IObservable item, TTarget target, System.Linq.Expressions.Expression> commandProperty)
where TTarget : class { }
- public static System.IDisposable InvokeCommand(this System.IObservable @this, TTarget target, System.Linq.Expressions.Expression>> commandProperty)
+ public static System.IDisposable InvokeCommand(this System.IObservable item, TTarget target, System.Linq.Expressions.Expression>> commandProperty)
where TTarget : class { }
}
public class ReactiveCommand : ReactiveUI.ReactiveCommandBase
@@ -516,8 +517,8 @@ namespace ReactiveUI
}
public class static ReactiveNotifyPropertyChangedMixin
{
- public static System.IObservable> ObservableForProperty(this TSender @this, System.Linq.Expressions.Expression> property, bool beforeChange = False, bool skipInitial = True) { }
- public static System.IObservable ObservableForProperty(this TSender @this, System.Linq.Expressions.Expression> property, System.Func selector, bool beforeChange = False)
+ public static System.IObservable> ObservableForProperty(this TSender item, System.Linq.Expressions.Expression> property, bool beforeChange = False, bool skipInitial = True) { }
+ public static System.IObservable ObservableForProperty(this TSender item, System.Linq.Expressions.Expression> property, System.Func selector, bool beforeChange = False)
where TSender : class { }
public static System.IObservable> SubscribeToExpressionChain(this TSender source, System.Linq.Expressions.Expression expression, bool beforeChange = False, bool skipInitial = True, bool suppressWarnings = False) { }
}
@@ -555,7 +556,7 @@ namespace ReactiveUI
public static System.Func GetValueFetcherOrThrow(System.Reflection.MemberInfo member) { }
public static System.Action GetValueSetterForProperty(System.Reflection.MemberInfo member) { }
public static System.Action GetValueSetterOrThrow(System.Reflection.MemberInfo member) { }
- public static bool IsStatic(this System.Reflection.PropertyInfo @this) { }
+ public static bool IsStatic(this System.Reflection.PropertyInfo item) { }
public static System.Type ReallyFindType(string type, bool throwOnFailure) { }
public static System.Linq.Expressions.Expression Rewrite(System.Linq.Expressions.Expression expression) { }
public static void ThrowIfMethodsNotOverloaded(string callingTypeName, object targetObject, params string[] methodsToCheck) { }
@@ -570,9 +571,9 @@ namespace ReactiveUI
}
public class static RoutableViewModelMixin
{
- public static System.IDisposable WhenNavigatedTo(this ReactiveUI.IRoutableViewModel @this, System.Func onNavigatedTo) { }
- public static System.IObservable WhenNavigatedToObservable(this ReactiveUI.IRoutableViewModel @this) { }
- public static System.IObservable WhenNavigatingFromObservable(this ReactiveUI.IRoutableViewModel @this) { }
+ public static System.IDisposable WhenNavigatedTo(this ReactiveUI.IRoutableViewModel item, System.Func onNavigatedTo) { }
+ public static System.IObservable WhenNavigatedToObservable(this ReactiveUI.IRoutableViewModel item) { }
+ public static System.IObservable WhenNavigatingFromObservable(this ReactiveUI.IRoutableViewModel item) { }
}
[System.Runtime.Serialization.DataContractAttribute()]
public class RoutingState : ReactiveUI.ReactiveObject
@@ -596,9 +597,9 @@ namespace ReactiveUI
}
public class static RoutingStateMixins
{
- public static T FindViewModelInStack(this ReactiveUI.RoutingState @this)
+ public static T FindViewModelInStack(this ReactiveUI.RoutingState item)
where T : ReactiveUI.IRoutableViewModel { }
- public static ReactiveUI.IRoutableViewModel GetCurrentViewModel(this ReactiveUI.RoutingState @this) { }
+ public static ReactiveUI.IRoutableViewModel GetCurrentViewModel(this ReactiveUI.RoutingState item) { }
}
public class static RxApp
{
@@ -634,10 +635,10 @@ namespace ReactiveUI
}
public class static SuspensionHostExtensions
{
- public static T GetAppState(this ReactiveUI.ISuspensionHost @this) { }
- public static System.IObservable ObserveAppState(this ReactiveUI.ISuspensionHost @this)
+ public static T GetAppState(this ReactiveUI.ISuspensionHost item) { }
+ public static System.IObservable ObserveAppState(this ReactiveUI.ISuspensionHost item)
where T : class { }
- public static System.IDisposable SetupDefaultSuspendResume(this ReactiveUI.ISuspensionHost @this, ReactiveUI.ISuspensionDriver driver = null) { }
+ public static System.IDisposable SetupDefaultSuspendResume(this ReactiveUI.ISuspensionHost item, ReactiveUI.ISuspensionDriver driver = null) { }
}
public class UnhandledErrorException : System.Exception
{
@@ -665,14 +666,14 @@ namespace ReactiveUI
}
public class static ViewForMixins
{
- public static void WhenActivated(this ReactiveUI.ISupportsActivation @this, System.Func> block) { }
- public static void WhenActivated(this ReactiveUI.ISupportsActivation @this, System.Action> block) { }
- public static void WhenActivated(this ReactiveUI.ISupportsActivation @this, System.Action block) { }
- public static System.IDisposable WhenActivated(this ReactiveUI.IActivatable @this, System.Func> block) { }
- public static System.IDisposable WhenActivated(this ReactiveUI.IActivatable @this, System.Func> block, ReactiveUI.IViewFor view) { }
- public static System.IDisposable WhenActivated(this ReactiveUI.IActivatable @this, System.Action> block) { }
- public static System.IDisposable WhenActivated(this ReactiveUI.IActivatable @this, System.Action> block, ReactiveUI.IViewFor view) { }
- public static System.IDisposable WhenActivated(this ReactiveUI.IActivatable @this, System.Action block, ReactiveUI.IViewFor view = null) { }
+ public static void WhenActivated(this ReactiveUI.ISupportsActivation item, System.Func> block) { }
+ public static void WhenActivated(this ReactiveUI.ISupportsActivation item, System.Action> block) { }
+ public static void WhenActivated(this ReactiveUI.ISupportsActivation item, System.Action block) { }
+ public static System.IDisposable WhenActivated(this ReactiveUI.IActivatable item, System.Func> block) { }
+ public static System.IDisposable WhenActivated(this ReactiveUI.IActivatable item, System.Func> block, ReactiveUI.IViewFor view) { }
+ public static System.IDisposable WhenActivated(this ReactiveUI.IActivatable item, System.Action> block) { }
+ public static System.IDisposable WhenActivated(this ReactiveUI.IActivatable item, System.Action> block, ReactiveUI.IViewFor view) { }
+ public static System.IDisposable WhenActivated(this ReactiveUI.IActivatable item, System.Action block, ReactiveUI.IViewFor view = null) { }
}
public class static ViewLocator
{
diff --git a/src/ReactiveUI.Tests/ReactiveUI.Tests.csproj b/src/ReactiveUI.Tests/ReactiveUI.Tests.csproj
index 486a6cddc3..f4895c2d26 100644
--- a/src/ReactiveUI.Tests/ReactiveUI.Tests.csproj
+++ b/src/ReactiveUI.Tests/ReactiveUI.Tests.csproj
@@ -3,6 +3,7 @@
netcoreapp2.0
$(TargetFrameworks);net461
+ latest
diff --git a/src/ReactiveUI.Uno/ActivationForViewFetcher.cs b/src/ReactiveUI.Uno/ActivationForViewFetcher.cs
new file mode 100644
index 0000000000..7308e4ce75
--- /dev/null
+++ b/src/ReactiveUI.Uno/ActivationForViewFetcher.cs
@@ -0,0 +1,66 @@
+// 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.
+
+using System;
+using System.Linq;
+using System.Reactive;
+using System.Reactive.Linq;
+using System.Reflection;
+
+using Windows.Foundation;
+using Windows.UI.Xaml;
+
+namespace ReactiveUI.Uno
+{
+ ///
+ /// ActiveationForViewFetcher is how ReactiveUI determine when a
+ /// View is activated or deactivated. This is usually only used when porting
+ /// ReactiveUI to a new UI framework.
+ ///
+ public class ActivationForViewFetcher : IActivationForViewFetcher
+ {
+ ///
+ public int GetAffinityForView(Type view)
+ {
+ return typeof(FrameworkElement).GetTypeInfo().IsAssignableFrom(view.GetTypeInfo()) ? 10 : 0;
+ }
+
+ ///
+ public IObservable GetActivationForView(IActivatable view)
+ {
+ var fe = view as FrameworkElement;
+
+ if (fe == null)
+ {
+ return Observable.Empty;
+ }
+
+#pragma warning disable SA1114 // Parameter list after.
+#if NETSTANDARD || MAC
+ var viewLoaded = Observable.FromEvent(
+#else
+ var viewLoaded = Observable.FromEvent, bool>(
+#endif
+ eventHandler => (_, __) => eventHandler(true),
+ x => fe.Loading += x,
+ x => fe.Loading -= x);
+
+ var viewUnloaded = Observable.FromEvent(
+ handler =>
+ {
+ void EventHandler(object sender, RoutedEventArgs e) => handler(false);
+ return EventHandler;
+ },
+ x => fe.Unloaded += x,
+ x => fe.Unloaded -= x);
+
+ return viewLoaded
+ .Merge(viewUnloaded)
+ .Select(b => b ? fe.WhenAnyValue(x => x.IsHitTestVisible).SkipWhile(x => !x) : Observables.False)
+ .Switch()
+ .DistinctUntilChanged();
+ }
+ }
+}
diff --git a/src/ReactiveUI.Uno/CoreDispatcherScheduler.cs b/src/ReactiveUI.Uno/CoreDispatcherScheduler.cs
new file mode 100644
index 0000000000..de999eff51
--- /dev/null
+++ b/src/ReactiveUI.Uno/CoreDispatcherScheduler.cs
@@ -0,0 +1,251 @@
+// 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.
+
+//
+
+using System;
+using System.Collections.Generic;
+using System.Reactive.Disposables;
+using System.Runtime.ExceptionServices;
+using System.Text;
+using System.Threading;
+
+using Windows.UI.Core;
+using Windows.UI.Xaml;
+
+namespace System.Reactive.Concurrency
+{
+ ///
+ /// Represents an object that schedules units of work on a .
+ ///
+ ///
+ /// This scheduler type is typically used indirectly through the and methods that use the current Dispatcher.
+ ///
+ [CLSCompliant(false)]
+ public sealed class CoreDispatcherScheduler : LocalScheduler, ISchedulerPeriodic
+ {
+ ///
+ /// Constructs a that schedules units of work on the given .
+ ///
+ /// Dispatcher to schedule work on.
+ /// is null .
+ public CoreDispatcherScheduler(CoreDispatcher dispatcher)
+ {
+ Dispatcher = dispatcher ?? throw new ArgumentNullException(nameof(dispatcher));
+ Priority = CoreDispatcherPriority.Normal;
+ }
+
+ ///
+ /// Constructs a that schedules units of work on the given with the given priority.
+ ///
+ /// Dispatcher to schedule work on.
+ /// Priority for scheduled units of work.
+ /// is null .
+ public CoreDispatcherScheduler(CoreDispatcher dispatcher, CoreDispatcherPriority priority)
+ {
+ Dispatcher = dispatcher ?? throw new ArgumentNullException(nameof(dispatcher));
+ Priority = priority;
+ }
+
+ ///
+ /// Gets the scheduler that schedules work on the associated with the current Window.
+ ///
+ public static CoreDispatcherScheduler Current
+ {
+ get
+ {
+ var window = Window.Current;
+ if (window == null)
+ {
+ throw new InvalidOperationException("There is no current window that has been created.");
+ }
+
+ return new CoreDispatcherScheduler(window.Dispatcher);
+ }
+ }
+
+ ///
+ /// Gets the associated with the .
+ ///
+ public CoreDispatcher Dispatcher { get; }
+
+ ///
+ /// Gets the priority at which work is scheduled.
+ ///
+ public CoreDispatcherPriority Priority { get; }
+
+ ///
+ /// Schedules an action to be executed on the dispatcher.
+ ///
+ /// The type of the state passed to the scheduled action.
+ /// State passed to the action to be executed.
+ /// Action to be executed.
+ /// The disposable object used to cancel the scheduled action (best effort).
+ /// is null .
+ public override IDisposable Schedule(TState state, Func action)
+ {
+ if (action == null)
+ {
+ throw new ArgumentNullException(nameof(action));
+ }
+
+ var d = new SingleAssignmentDisposable();
+
+ var res = Dispatcher.RunAsync(Priority, () =>
+ {
+ if (!d.IsDisposed)
+ {
+ try
+ {
+ d.Disposable = action(this, state);
+ }
+ catch (Exception ex)
+ {
+ //
+ // Work-around for the behavior of throwing from RunAsync not propagating
+ // the exception to the Application.UnhandledException event (as of W8RP)
+ // as our users have come to expect from previous XAML stacks using Rx.
+ //
+ // If we wouldn't do this, there'd be an observable behavioral difference
+ // between scheduling with TimeSpan.Zero or using this overload.
+ //
+ // For scheduler implementation guidance rules, see TaskPoolScheduler.cs
+ // in System.Reactive.PlatformServices\Reactive\Concurrency.
+ //
+ var timer = new DispatcherTimer
+ {
+ Interval = TimeSpan.Zero
+ };
+ timer.Tick += (o, e) =>
+ {
+ timer.Stop();
+ ExceptionDispatchInfo.Capture(ex).Throw();
+ };
+
+ timer.Start();
+ }
+ }
+ });
+
+ return StableCompositeDisposable.Create(
+ d,
+ Disposable.Create(res, _ => _.Cancel())
+ );
+ }
+
+ ///
+ /// Schedules an action to be executed after on the dispatcher, using a object.
+ ///
+ /// The type of the state passed to the scheduled action.
+ /// State passed to the action to be executed.
+ /// Action to be executed.
+ /// Relative time after which to execute the action.
+ /// The disposable object used to cancel the scheduled action (best effort).
+ /// is null .
+ public override IDisposable Schedule(TState state, TimeSpan dueTime, Func action)
+ {
+ if (action == null)
+ {
+ throw new ArgumentNullException(nameof(action));
+ }
+
+ var dt = Scheduler.Normalize(dueTime);
+ if (dt.Ticks == 0)
+ {
+ return Schedule(state, action);
+ }
+
+ return ScheduleSlow(state, dt, action);
+ }
+
+ private IDisposable ScheduleSlow(TState state, TimeSpan dueTime, Func action)
+ {
+ var d = new MultipleAssignmentDisposable();
+
+ var timer = new DispatcherTimer();
+
+ timer.Tick += (o, e) =>
+ {
+ var t = Interlocked.Exchange(ref timer, null);
+ if (t != null)
+ {
+ try
+ {
+ d.Disposable = action(this, state);
+ }
+ finally
+ {
+ t.Stop();
+ action = null;
+ }
+ }
+ };
+
+ timer.Interval = dueTime;
+ timer.Start();
+
+ d.Disposable = Disposable.Create(() =>
+ {
+ var t = Interlocked.Exchange(ref timer, null);
+ if (t != null)
+ {
+ t.Stop();
+ action = (_, __) => Disposable.Empty;
+ }
+ });
+
+ return d;
+ }
+
+ ///
+ /// Schedules a periodic piece of work on the dispatcher, using a object.
+ ///
+ /// The type of the state passed to the scheduled action.
+ /// Initial state passed to the action upon the first iteration.
+ /// Period for running the work periodically.
+ /// Action to be executed, potentially updating the state.
+ /// The disposable object used to cancel the scheduled recurring action (best effort).
+ /// is null .
+ /// is less than .
+ public IDisposable SchedulePeriodic(TState state, TimeSpan period, Func action)
+ {
+ //
+ // According to MSDN documentation, the default is TimeSpan.Zero, so that's definitely valid.
+ // Empirical observation - negative values seem to be normalized to TimeSpan.Zero, but let's not go there.
+ //
+ if (period < TimeSpan.Zero)
+ {
+ throw new ArgumentOutOfRangeException(nameof(period));
+ }
+
+ if (action == null)
+ {
+ throw new ArgumentNullException(nameof(action));
+ }
+
+ var timer = new DispatcherTimer();
+
+ var state1 = state;
+
+ timer.Tick += (o, e) =>
+ {
+ state1 = action(state1);
+ };
+
+ timer.Interval = period;
+ timer.Start();
+
+ return Disposable.Create(() =>
+ {
+ var t = Interlocked.Exchange(ref timer, null);
+ if (t != null)
+ {
+ t.Stop();
+ action = _ => _;
+ }
+ });
+ }
+ }
+}
diff --git a/src/ReactiveUI.Uno/PlatformRegistrations.cs b/src/ReactiveUI.Uno/PlatformRegistrations.cs
new file mode 100644
index 0000000000..3ce709dcc8
--- /dev/null
+++ b/src/ReactiveUI.Uno/PlatformRegistrations.cs
@@ -0,0 +1,49 @@
+// 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.
+
+using System;
+using System.Reactive.Concurrency;
+using System.Reactive.PlatformServices;
+
+namespace ReactiveUI.Uno
+{
+ ///