Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Added Uno support (#2067) #11

Merged
merged 19 commits into from
Jul 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
121458e
feature: Added Uno support (#2067)
weitzhandler Jun 26, 2019
7d16f20
fix: uno not including ReactiveUI NuGet package (#2091)
glennawatson Jun 27, 2019
780a4bb
housekeeping: Update alumni section.
glennawatson Jun 27, 2019
3c185b1
housekeeping: fix analyzer warnings that have appeared in the fxcop (…
glennawatson Jun 27, 2019
73b225b
build(deps): bump FodyHelpers from 5.1.0 to 5.1.1 (#2094)
dependabot-preview[bot] Jun 28, 2019
ffac207
build(deps): bump FodyPackaging from 5.1.0 to 5.1.1 (#2095)
dependabot-preview[bot] Jun 28, 2019
bc4c4da
build(deps): bump Fody from 5.1.0 to 5.1.1 (#2096)
dependabot-preview[bot] Jun 28, 2019
6846fb1
housekeeping: Release ReactiveUI 9.18
glennawatson Jun 28, 2019
2089f59
feature: allow uno namespace for uap17.0.17763 (#2099)
glennawatson Jun 29, 2019
8200d37
build(deps): bump Roslynator.Analyzers from 2.1.0-rc to 2.1.0 (#2111)
dependabot-preview[bot] Jul 1, 2019
312c0f8
build(deps): update Splat requirement from 7.* to 8.* (#2110)
dependabot-preview[bot] Jul 1, 2019
1faeeda
build(deps): bump Microsoft.NET.Test.Sdk from 16.1.1 to 16.2.0 (#2109)
dependabot-preview[bot] Jul 1, 2019
4d4a6af
build(deps): bump Microsoft.SourceLink.GitHub (#2108)
dependabot-preview[bot] Jul 1, 2019
e53ec4c
build(deps): update Splat.Autofac requirement from 7.* to 8.* (#2107)
dependabot-preview[bot] Jul 1, 2019
698f0fc
build(deps): bump PublicApiGenerator from 9.0.0 to 9.1.0 (#2104)
dependabot-preview[bot] Jul 1, 2019
fbad0f9
build(deps): update Splat.Ninject requirement from 7.* to 8.* (#2105)
dependabot-preview[bot] Jul 1, 2019
bb9ed3e
build(deps): update Splat.DryIoc requirement from 7.* to 8.* (#2106)
dependabot-preview[bot] Jul 1, 2019
2fc4e6e
fix: Replace default `MainThreadScheduler` on UAP (#2100)
hinterlandcreative Jul 1, 2019
ebd58cb
build(deps): bump Microsoft.SourceLink.GitHub (#2113)
dependabot-preview[bot] Jul 2, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,17 +298,11 @@ ReactiveUI is part of the [.NET Foundation](https://www.dotnetfoundation.org/).
<table>
<tbody>
<tr>
<td align="center" valign="top">
<img width="100" height="100" src="https://github.com/ghuntley.png?s=150">
<br>
<a href="https://github.com/ghuntley">Geoffrey Huntley</a>
<p>Sydney, Australia</p>
</td>
<td align="center" valign="top">
<img width="100" height="100" src="https://github.com/glennawatson.png?s=150">
<br>
<a href="https://github.com/glennawatson">Glenn Watson</a>
<p>Washington, USA</p>
<p>Melbourne, Australia</p>
</td>
<td align="center" valign="top">
<img width="100" height="100" src="https://github.com/rlittlesii.png?s=150">
Expand Down Expand Up @@ -339,6 +333,12 @@ The following have been core team members in the past.
<table>
<tbody>
<tr>
<td align="center" valign="top">
<img width="100" height="100" src="https://github.com/ghuntley.png?s=150">
<br>
<a href="https://github.com/ghuntley">Geoffrey Huntley</a>
<p>Sydney, Australia</p>
</td>
<td align="center" valign="top">
<img width="100" height="100" src="https://github.com/kentcb.png?s=150">
<br>
Expand Down
1 change: 1 addition & 0 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var packageWhitelist = new List<FilePath>
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())
Expand Down
8 changes: 4 additions & 4 deletions src/Directory.build.props
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,22 @@
</PropertyGroup>

<ItemGroup Condition="$(IsTestProject)">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.1.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.console" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="Xunit.StaFact" Version="0.3.18" />
<PackageReference Include="Shouldly" Version="4.0.0-beta0002" />
<PackageReference Include="Microsoft.Reactive.Testing" Version="4.1.5" />
<PackageReference Include="PublicApiGenerator" Version="9.0.0" />
<PackageReference Include="PublicApiGenerator" Version="9.1.0" />
</ItemGroup>

<ItemGroup Condition="$(IsTestProject)">
<Compile Include="$(MSBuildThisFileDirectory)ApiGeneratorGlobalSuppressions.cs" />
</ItemGroup>

<ItemGroup Condition="'$(IsTestProject)' != 'true' and '$(SourceLinkEnabled)' != 'false'">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-19270-01" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-19351-01" PrivateAssets="All" />
</ItemGroup>

<PropertyGroup>
Expand All @@ -74,7 +74,7 @@
<ItemGroup>
<PackageReference Include="stylecop.analyzers" Version="1.1.118" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.3" PrivateAssets="all" />
<PackageReference Include="Roslynator.Analyzers" Version="2.1.0-rc" PrivateAssets="All" />
<PackageReference Include="Roslynator.Analyzers" Version="2.1.0" PrivateAssets="All" />
<PackageReference Condition="'$(OS)' == 'Windows_NT'" Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.3" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
Expand Down
5 changes: 5 additions & 0 deletions src/ReactiveUI.AndroidSupport/ControlFetcherMixin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ public static class ControlFetcherMixin
/// <param name="resolveMembers">The resolve members.</param>
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)
Expand Down
18 changes: 16 additions & 2 deletions src/ReactiveUI.AndroidSupport/ReactivePagerAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,23 @@ public override Object InstantiateItem(ViewGroup container, int position)
}

/// <inheritdoc/>
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);
}

Expand Down
12 changes: 11 additions & 1 deletion src/ReactiveUI.AndroidSupport/ReactiveRecyclerViewAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,17 @@ public virtual int GetItemViewType(int position, TViewModel viewModel)
/// <inheritdoc/>
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);
}

/// <inheritdoc/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFrameworks>MonoAndroid81</TargetFrameworks>
<Description>ReactiveUI extensions for the Android Support Library</Description>
<PackageId>ReactiveUI.AndroidSupport</PackageId>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
25 changes: 17 additions & 8 deletions src/ReactiveUI.Blend/FollowObservableStateBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,26 @@ public FrameworkElement TargetObject
/// <param name="e">The <see cref="DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
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<string>)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<string>)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
Expand All @@ -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);
});
}

Expand Down
6 changes: 5 additions & 1 deletion src/ReactiveUI.Blend/Platforms/net461/ObservableTrigger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ public IObservable<object> Observable
/// <param name="e">The <see cref="DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
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();
Expand Down
1 change: 1 addition & 0 deletions src/ReactiveUI.Blend/ReactiveUI.Blend.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<RootNamespace>ReactiveUI.Blend</RootNamespace>
<Description>Blend behaviors for ReactiveUI</Description>
<PackageId>ReactiveUI.Blend</PackageId>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
16 changes: 13 additions & 3 deletions src/ReactiveUI.Fody.Helpers/ObservableAsPropertyExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static class ObservableAsPropertyExtensions
/// </summary>
/// <typeparam name="TObj">The type of the object.</typeparam>
/// <typeparam name="TRet">The type of the ret.</typeparam>
/// <param name="this">The this.</param>
/// <param name="item">The observable with the return value.</param>
/// <param name="source">The source.</param>
/// <param name="property">The property.</param>
/// <param name="initialValue">The initial value.</param>
Expand All @@ -32,10 +32,20 @@ public static class ObservableAsPropertyExtensions
/// or
/// Backing field not found for " + propertyInfo.
/// </exception>
public static ObservableAsPropertyHelper<TRet> ToPropertyEx<TObj, TRet>(this IObservable<TRet> @this, TObj source, Expression<Func<TObj, TRet>> property, TRet initialValue = default(TRet), bool deferSubscription = false, IScheduler scheduler = null)
public static ObservableAsPropertyHelper<TRet> ToPropertyEx<TObj, TRet>(this IObservable<TRet> item, TObj source, Expression<Func<TObj, TRet>> 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();
Expand Down
5 changes: 3 additions & 2 deletions src/ReactiveUI.Fody.Helpers/ReactiveUI.Fody.Helpers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@

<!-- Due to fody insisting on having .net 4 classes, we can't pack on non-windows -->
<IsPackable Condition=" '$(OS)' != 'Windows_NT' ">false</IsPackable>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Fody" Version="5.1.0" PrivateAssets="None" />
<PackageReference Include="FodyPackaging" Version="5.1.0" PrivateAssets="All" />
<PackageReference Include="Fody" Version="5.1.1" PrivateAssets="None" />
<PackageReference Include="FodyPackaging" Version="5.1.1" PrivateAssets="All" />
<PackageReference Include="System.Reactive" Version="4.1.5" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ReactiveUI.Fody.Helpers
}
public class static ObservableAsPropertyExtensions
{
public static ReactiveUI.ObservableAsPropertyHelper<TRet> ToPropertyEx<TObj, TRet>(this System.IObservable<TRet> @this, TObj source, System.Linq.Expressions.Expression<System.Func<TObj, TRet>> property, TRet initialValue = null, bool deferSubscription = False, System.Reactive.Concurrency.IScheduler scheduler = null)
public static ReactiveUI.ObservableAsPropertyHelper<TRet> ToPropertyEx<TObj, TRet>(this System.IObservable<TRet> item, TObj source, System.Linq.Expressions.Expression<System.Func<TObj, TRet>> 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)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ReactiveUI.Fody.Helpers
}
public class static ObservableAsPropertyExtensions
{
public static ReactiveUI.ObservableAsPropertyHelper<TRet> ToPropertyEx<TObj, TRet>(this System.IObservable<TRet> @this, TObj source, System.Linq.Expressions.Expression<System.Func<TObj, TRet>> property, TRet initialValue = null, bool deferSubscription = False, System.Reactive.Concurrency.IScheduler scheduler = null)
public static ReactiveUI.ObservableAsPropertyHelper<TRet> ToPropertyEx<TObj, TRet>(this System.IObservable<TRet> item, TObj source, System.Linq.Expressions.Expression<System.Func<TObj, TRet>> 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)]
Expand Down
1 change: 1 addition & 0 deletions src/ReactiveUI.Fody.Tests/ReactiveUI.Fody.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TargetFrameworks);net461</TargetFrameworks>
<FodyTargetFramework>netstandard2.0</FodyTargetFramework>
<FodyTargetFramework Condition=" $(TargetFramework.StartsWith('net4')) ">$(TargetFramework)</FodyTargetFramework>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading