Skip to content

Commit b61d262

Browse files
authored
Merge pull request #11 from reactiveui/master
feature: Added Uno support (reactiveui#2067)
2 parents cb28c9c + ebd58cb commit b61d262

File tree

118 files changed

+1882
-425
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+1882
-425
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -298,17 +298,11 @@ ReactiveUI is part of the [.NET Foundation](https://www.dotnetfoundation.org/).
298298
<table>
299299
<tbody>
300300
<tr>
301-
<td align="center" valign="top">
302-
<img width="100" height="100" src="https://github.com/ghuntley.png?s=150">
303-
<br>
304-
<a href="https://github.com/ghuntley">Geoffrey Huntley</a>
305-
<p>Sydney, Australia</p>
306-
</td>
307301
<td align="center" valign="top">
308302
<img width="100" height="100" src="https://github.com/glennawatson.png?s=150">
309303
<br>
310304
<a href="https://github.com/glennawatson">Glenn Watson</a>
311-
<p>Washington, USA</p>
305+
<p>Melbourne, Australia</p>
312306
</td>
313307
<td align="center" valign="top">
314308
<img width="100" height="100" src="https://github.com/rlittlesii.png?s=150">
@@ -339,6 +333,12 @@ The following have been core team members in the past.
339333
<table>
340334
<tbody>
341335
<tr>
336+
<td align="center" valign="top">
337+
<img width="100" height="100" src="https://github.com/ghuntley.png?s=150">
338+
<br>
339+
<a href="https://github.com/ghuntley">Geoffrey Huntley</a>
340+
<p>Sydney, Australia</p>
341+
</td>
342342
<td align="center" valign="top">
343343
<img width="100" height="100" src="https://github.com/kentcb.png?s=150">
344344
<br>

build.cake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ var packageWhitelist = new List<FilePath>
2424
MakeAbsolute(File("./src/ReactiveUI.Fody.Helpers/ReactiveUI.Fody.Helpers.csproj")),
2525
MakeAbsolute(File("./src/ReactiveUI.AndroidSupport/ReactiveUI.AndroidSupport.csproj")),
2626
MakeAbsolute(File("./src/ReactiveUI.XamForms/ReactiveUI.XamForms.csproj")),
27+
MakeAbsolute(File("./src/ReactiveUI.Uno/ReactiveUI.Uno.csproj")),
2728
};
2829

2930
if (IsRunningOnWindows())

src/Directory.build.props

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,22 @@
4141
</PropertyGroup>
4242

4343
<ItemGroup Condition="$(IsTestProject)">
44-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.1.1" />
44+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
4545
<PackageReference Include="xunit" Version="2.4.1" />
4646
<PackageReference Include="xunit.runner.console" Version="2.4.1" />
4747
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
4848
<PackageReference Include="Xunit.StaFact" Version="0.3.18" />
4949
<PackageReference Include="Shouldly" Version="4.0.0-beta0002" />
5050
<PackageReference Include="Microsoft.Reactive.Testing" Version="4.1.5" />
51-
<PackageReference Include="PublicApiGenerator" Version="9.0.0" />
51+
<PackageReference Include="PublicApiGenerator" Version="9.1.0" />
5252
</ItemGroup>
5353

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

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

6262
<PropertyGroup>
@@ -74,7 +74,7 @@
7474
<ItemGroup>
7575
<PackageReference Include="stylecop.analyzers" Version="1.1.118" PrivateAssets="all" />
7676
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.3" PrivateAssets="all" />
77-
<PackageReference Include="Roslynator.Analyzers" Version="2.1.0-rc" PrivateAssets="All" />
77+
<PackageReference Include="Roslynator.Analyzers" Version="2.1.0" PrivateAssets="All" />
7878
<PackageReference Condition="'$(OS)' == 'Windows_NT'" Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.3" PrivateAssets="all" />
7979
</ItemGroup>
8080
<ItemGroup>

src/ReactiveUI.AndroidSupport/ControlFetcherMixin.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ public static class ControlFetcherMixin
2626
/// <param name="resolveMembers">The resolve members.</param>
2727
public static void WireUpControls(this Fragment fragment, View inflatedView, ResolveStrategy resolveMembers = ResolveStrategy.Implicit)
2828
{
29+
if (fragment == null)
30+
{
31+
throw new ArgumentNullException(nameof(fragment));
32+
}
33+
2934
var members = fragment.GetWireUpMembers(resolveMembers);
3035

3136
foreach (var member in members)

src/ReactiveUI.AndroidSupport/ReactivePagerAdapter.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,23 @@ public override Object InstantiateItem(ViewGroup container, int position)
8181
}
8282

8383
/// <inheritdoc/>
84-
public override void DestroyItem(ViewGroup container, int position, Object @object)
84+
public override void DestroyItem(ViewGroup container, int position, Object item)
8585
{
86-
var view = (View)@object;
86+
if (container == null)
87+
{
88+
throw new ArgumentNullException(nameof(container));
89+
}
90+
91+
if (item == null)
92+
{
93+
throw new ArgumentNullException(nameof(item));
94+
}
95+
96+
if (!(item is View view))
97+
{
98+
throw new ArgumentException("Item must be of type View", nameof(item));
99+
}
100+
87101
container.RemoveView(view);
88102
}
89103

src/ReactiveUI.AndroidSupport/ReactiveRecyclerViewAdapter.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,17 @@ public virtual int GetItemViewType(int position, TViewModel viewModel)
7373
/// <inheritdoc/>
7474
public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
7575
{
76-
((IViewFor)holder).ViewModel = GetViewModelByPosition(position);
76+
if (holder == null)
77+
{
78+
throw new ArgumentNullException(nameof(holder));
79+
}
80+
81+
if (!(holder is IViewFor viewForHolder))
82+
{
83+
throw new ArgumentException("Holder must be derived from IViewFor", nameof(holder));
84+
}
85+
86+
viewForHolder.ViewModel = GetViewModelByPosition(position);
7787
}
7888

7989
/// <inheritdoc/>

src/ReactiveUI.AndroidSupport/ReactiveUI.AndroidSupport.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<TargetFrameworks>MonoAndroid81</TargetFrameworks>
55
<Description>ReactiveUI extensions for the Android Support Library</Description>
66
<PackageId>ReactiveUI.AndroidSupport</PackageId>
7+
<LangVersion>latest</LangVersion>
78
</PropertyGroup>
89

910
<ItemGroup>

src/ReactiveUI.Blend/FollowObservableStateBehavior.cs

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,26 @@ public FrameworkElement TargetObject
8989
/// <param name="e">The <see cref="DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
9090
protected static void OnStateObservableChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
9191
{
92-
var @this = (FollowObservableStateBehavior)sender;
93-
if (@this._watcher != null)
92+
if (e == null)
9493
{
95-
@this._watcher.Dispose();
96-
@this._watcher = null;
94+
throw new ArgumentNullException(nameof(e));
9795
}
9896

99-
@this._watcher = ((IObservable<string>)e.NewValue).ObserveOn(RxApp.MainThreadScheduler).Subscribe(
97+
if (!(sender is FollowObservableStateBehavior item))
98+
{
99+
throw new ArgumentException("Sender must be of type " + nameof(FollowObservableStateBehavior), nameof(sender));
100+
}
101+
102+
if (item._watcher != null)
103+
{
104+
item._watcher.Dispose();
105+
item._watcher = null;
106+
}
107+
108+
item._watcher = ((IObservable<string>)e.NewValue).ObserveOn(RxApp.MainThreadScheduler).Subscribe(
100109
x =>
101110
{
102-
var target = @this.TargetObject ?? @this.AssociatedObject;
111+
var target = item.TargetObject ?? item.AssociatedObject;
103112
#if NETFX_CORE
104113
VisualStateManager.GoToState(target, x, true);
105114
#else
@@ -115,12 +124,12 @@ protected static void OnStateObservableChanged(DependencyObject sender, Dependen
115124
},
116125
ex =>
117126
{
118-
if (!@this.AutoResubscribeOnError)
127+
if (!item.AutoResubscribeOnError)
119128
{
120129
return;
121130
}
122131

123-
OnStateObservableChanged(@this, e);
132+
OnStateObservableChanged(item, e);
124133
});
125134
}
126135

src/ReactiveUI.Blend/Platforms/net461/ObservableTrigger.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ public IObservable<object> Observable
4747
/// <param name="e">The <see cref="DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
4848
protected static void OnObservableChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
4949
{
50-
ObservableTrigger triggerItem = (ObservableTrigger)sender;
50+
if (!(sender is ObservableTrigger triggerItem))
51+
{
52+
throw new ArgumentException("Sender must be of type " + nameof(ObservableTrigger), nameof(sender));
53+
}
54+
5155
if (triggerItem._watcher != null)
5256
{
5357
triggerItem._watcher.Dispose();

src/ReactiveUI.Blend/ReactiveUI.Blend.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<RootNamespace>ReactiveUI.Blend</RootNamespace>
77
<Description>Blend behaviors for ReactiveUI</Description>
88
<PackageId>ReactiveUI.Blend</PackageId>
9+
<LangVersion>latest</LangVersion>
910
</PropertyGroup>
1011

1112
<ItemGroup>

0 commit comments

Comments
 (0)