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

Merged
merged 35 commits into from
Jun 26, 2019
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
0c38232
Added wasm files.
weitzhandler Jun 12, 2019
bee2b58
Fixed ReactivePage.OnViewModelChanging implementation
weitzhandler Jun 12, 2019
08a8c04
Merge branch 'master' into master
glennawatson Jun 12, 2019
7bbab71
Merge branch 'master' into master
glennawatson Jun 15, 2019
ea5fd6c
Merge branch 'master' into master
glennawatson Jun 16, 2019
009d692
Added Uno platform initial support
weitzhandler Jun 17, 2019
21ae794
Fixed linked files references
weitzhandler Jun 17, 2019
5f788b6
Merge branch 'master' into master
weitzhandler Jun 17, 2019
99e1f39
Fix wrong preprocessor directive
weitzhandler Jun 17, 2019
10ee94a
Merge branch 'master' of https://github.com/weitzhandler/ReactiveUI
weitzhandler Jun 17, 2019
c284a5e
Fixes
glennawatson Jun 17, 2019
fc9e3bc
Updated message suppression
weitzhandler Jun 17, 2019
3472b76
Expanded suppression messages
weitzhandler Jun 17, 2019
780abf2
Deleting g.cs file manually
weitzhandler Jun 17, 2019
684c979
extensions for reactiveui
ghuntley Jun 18, 2019
ba00181
Remove HAS_UNO directive from production
weitzhandler Jun 18, 2019
7497685
Updated Uno Platform brand name
weitzhandler Jun 18, 2019
36bdda5
Updated Reactive.Wasm to the new NuGet package
weitzhandler Jun 18, 2019
bf55094
further work
glennawatson Jun 18, 2019
d20cb8e
merge
glennawatson Jun 18, 2019
0e3932c
Add back in the ReactivePage.cs
glennawatson Jun 18, 2019
14ea219
remove the reactive page since that will be added to the windows-comm…
glennawatson Jun 18, 2019
1bcfb19
Merge branch 'master' into master
glennawatson Jun 18, 2019
335034d
Add Uno to RxUI initialization
weitzhandler Jun 19, 2019
9f064fb
Added some README stuff about Uno
weitzhandler Jun 19, 2019
a1db0c2
Update README.md
weitzhandler Jun 19, 2019
0973481
Merge branch 'master' into master
glennawatson Jun 19, 2019
fe9c1c7
Reverted README changes
weitzhandler Jun 19, 2019
d774634
Merge branch 'master' into master
glennawatson Jun 23, 2019
8b637b0
Merge branch 'master' into master
glennawatson Jun 25, 2019
aaf53e7
adding results to parent directories
glennawatson Jun 25, 2019
f6148b7
Further work on getting uno in
glennawatson Jun 26, 2019
214b5a8
Remove the events project, will be back in another iteration
glennawatson Jun 26, 2019
a25e37f
turn off exception when in WASM mode
glennawatson Jun 26, 2019
0df2271
grouped registrations
RLittlesII Jun 26, 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
1 change: 1 addition & 0 deletions src/ReactiveUI.Fody.Tests/FodyWeavers.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ReactiveUI.Fody.deps" minOccurs="0" maxOccurs="1" type="xs:anyType" />
<xs:element name="ReactiveUI" minOccurs="0" maxOccurs="1" type="xs:anyType" />
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
Expand Down
33 changes: 33 additions & 0 deletions src/ReactiveUI.Uno/ReactiveUI.Uno.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<Project Sdk="MSBuild.Sdk.Extras">
<PropertyGroup>
<TargetFrameworks>xamarinmac20;MonoAndroid90;xamarinios10;netstandard2.0</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TargetFrameworks);uap10.0.17763</TargetFrameworks>
<PackageId>ReactiveUI.Uno</PackageId>
<Title></Title>
<Description>Uno-Platform specific extensions to ReactiveUI</Description>
weitzhandler marked this conversation as resolved.
Show resolved Hide resolved
<TargetFrameworks>netstandard2.0</TargetFrameworks>
</PropertyGroup>
<PropertyGroup>
<DefineConstants>HAS_UNO</DefineConstants>
weitzhandler marked this conversation as resolved.
Show resolved Hide resolved
</PropertyGroup>
<ItemGroup>
<Compile Include="..\ReactiveUI\Platforms\windows-common\**\*.cs" />

<Compile Include="..\ReactiveUI\Interfaces\IPlatformOperations.cs" Link="IPlatformOperations.cs" />
<Compile Include="..\ReactiveUI\Observable.cs" Link="Observable.cs" />
<Compile Include="..\ReactiveUI\Platforms\uap\TransitioningContentControl.Empty.cs" Link="TransitioningContentControl.Empty.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Uno.UI" Version="1.44.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\ReactiveUI\ReactiveUI.csproj" />
</ItemGroup>

<ItemGroup Condition="$(TargetFramework.StartsWith('netstandard'))">
<PackageReference Include="Rx.Uno.Wasm" Version="0.1.0" />
</ItemGroup>

</Project>
67 changes: 63 additions & 4 deletions src/ReactiveUI.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26730.15

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
RLittlesII marked this conversation as resolved.
Show resolved Hide resolved
VisualStudioVersion = 16.0.29001.49
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{BD9762CF-E104-481C-96A6-26E624B86283}"
ProjectSection(SolutionItems) = preProject
Expand Down Expand Up @@ -38,7 +39,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReactiveUI.Fody.Tests", "Re
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReactiveUI.Splat.Tests", "ReactiveUI.Splat.Tests\ReactiveUI.Splat.Tests.csproj", "{7ED6D69F-138F-40BD-9F37-3E4050E4D19B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReactiveUI.Testing.Tests", "ReactiveUI.Testing.Tests\ReactiveUI.Testing.Tests.csproj", "{CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReactiveUI.Testing.Tests", "ReactiveUI.Testing.Tests\ReactiveUI.Testing.Tests.csproj", "{CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReactiveUI.Uno", "ReactiveUI.Uno\ReactiveUI.Uno.csproj", "{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -816,6 +819,62 @@ Global
{CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Release|x64.Build.0 = Release|Any CPU
{CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Release|x86.ActiveCfg = Release|Any CPU
{CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Release|x86.Build.0 = Release|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Ad-Hoc|Mixed Platforms.ActiveCfg = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Ad-Hoc|Mixed Platforms.Build.0 = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Ad-Hoc|x64.Build.0 = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.AppStore|Any CPU.Build.0 = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.AppStore|ARM.ActiveCfg = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.AppStore|ARM.Build.0 = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.AppStore|iPhone.Build.0 = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.AppStore|Mixed Platforms.ActiveCfg = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.AppStore|Mixed Platforms.Build.0 = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.AppStore|x64.ActiveCfg = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.AppStore|x64.Build.0 = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.AppStore|x86.ActiveCfg = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.AppStore|x86.Build.0 = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Debug|ARM.ActiveCfg = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Debug|ARM.Build.0 = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Debug|iPhone.Build.0 = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Debug|x64.ActiveCfg = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Debug|x64.Build.0 = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Debug|x86.ActiveCfg = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Debug|x86.Build.0 = Debug|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Release|Any CPU.Build.0 = Release|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Release|ARM.ActiveCfg = Release|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Release|ARM.Build.0 = Release|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Release|iPhone.ActiveCfg = Release|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Release|iPhone.Build.0 = Release|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Release|x64.ActiveCfg = Release|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Release|x64.Build.0 = Release|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Release|x86.ActiveCfg = Release|Any CPU
{36FC3269-B7D0-4D79-A54A-B26B6190E8A2}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
4 changes: 1 addition & 3 deletions src/ReactiveUI/Platforms/uap/ActivationForViewFetcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
using System.Linq;
using System.Reactive.Linq;
using System.Reflection;
using System.Windows;

using Windows.UI.Xaml;

namespace ReactiveUI
Expand Down Expand Up @@ -51,4 +49,4 @@ public IObservable<bool> GetActivationForView(IActivatable view)
.DistinctUntilChanged();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
// 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.Diagnostics.CodeAnalysis;
using Windows.UI.Xaml.Controls;

namespace ReactiveUI
{
/// <summary>
/// A control with a single transition.
/// </summary>
[SuppressMessage("Design", "CA1010:Collections should implement generic interface", Justification = "Deliberate usage")]
public class TransitioningContentControl : ContentControl
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System;
using System.Linq;

#if NETFX_CORE
#if NETFX_CORE || HAS_UNO
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Markup;
Expand All @@ -30,10 +30,11 @@ public class AutoDataTemplateBindingHook : IPropertyBindingHook
/// </summary>
public static Lazy<DataTemplate> DefaultItemTemplate { get; } = new Lazy<DataTemplate>(() =>
{
#if NETFX_CORE
const string template = "<DataTemplate xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:xaml='using:ReactiveUI'>" +
"<xaml:ViewModelViewHost ViewModel=\"{Binding}\" VerticalContentAlignment=\"Stretch\" HorizontalContentAlignment=\"Stretch\" IsTabStop=\"False\" />" +
"</DataTemplate>";
#if NETFX_CORE || HAS_UNO
const string template =
@"<DataTemplate xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:xaml='using:ReactiveUI'>
<xaml:ViewModelViewHost ViewModel=""{Binding}"" VerticalContentAlignment=""Stretch"" HorizontalContentAlignment=""Stretch"" IsTabStop=""False"" />
</DataTemplate>";
return (DataTemplate)XamlReader.Load(template);
#else
const string template = "<DataTemplate xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

using System;
using System.Diagnostics.CodeAnalysis;
#if NETFX_CORE
#if NETFX_CORE || HAS_UNO
using Windows.UI.Xaml;
#else
using System.Windows;
Expand All @@ -30,7 +30,7 @@ public enum BooleanToVisibilityHint
/// </summary>
Inverse = 1 << 1,

#if !NETFX_CORE
#if !NETFX_CORE && !HAS_UNO
/// <summary>
/// Use the hidden version rather than the Collapsed.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// See the LICENSE file in the project root for full license information.

using System;
#if NETFX_CORE
#if NETFX_CORE || HAS_UNO
using Windows.UI.Xaml;
#else
using System.Windows;
Expand Down Expand Up @@ -44,7 +44,7 @@ public bool TryConvert(object from, Type toType, object conversionHint, out obje
if (toType == typeof(Visibility))
{
var fromAsBool = hint.HasFlag(BooleanToVisibilityHint.Inverse) ? !(bool)@from : (bool)from;
#if !NETFX_CORE
#if !NETFX_CORE && !HAS_UNO
var notVisible = hint.HasFlag(BooleanToVisibilityHint.UseHidden) ? Visibility.Hidden : Visibility.Collapsed;
#else
var notVisible = Visibility.Collapsed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class PlatformOperations : IPlatformOperations
/// <inheritdoc/>
public string GetOrientation()
{
#if NETFX_CORE
#if NETFX_CORE || HAS_UNO
return Windows.Graphics.Display.DisplayInformation.GetForCurrentView().CurrentOrientation.ToString();
#else
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

namespace ReactiveUI
{
#if NETFX_CORE
using System.Diagnostics.CodeAnalysis;
#if NETFX_CORE || HAS_UNO
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
#else
Expand Down Expand Up @@ -76,6 +77,7 @@ namespace ReactiveUI
/// <typeparam name="TViewModel">
/// The type of the view model backing the view.
/// </typeparam>
[SuppressMessage("Design", "CA1010:Collections should implement generic interface", Justification = "Deliberate usage")]
public abstract class ReactiveUserControl<TViewModel> :
UserControl, IViewFor<TViewModel>
where TViewModel : class
Expand Down
4 changes: 3 additions & 1 deletion src/ReactiveUI/Platforms/windows-common/RoutedViewHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@

using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reactive.Linq;
using System.Windows;
using ReactiveUI;
using Splat;

#if NETFX_CORE
#if NETFX_CORE || HAS_UNO
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
#else
Expand All @@ -25,6 +26,7 @@ namespace ReactiveUI
/// the View and wire up the ViewModel whenever a new ViewModel is
/// navigated to. Put this control as the only control in your Window.
/// </summary>
[SuppressMessage("Design", "CA1010:Collections should implement generic interface", Justification = "Deliberate usage")]
public class RoutedViewHost : TransitioningContentControl, IActivatable, IEnableLogger
{
/// <summary>
Expand Down
11 changes: 9 additions & 2 deletions src/ReactiveUI/Platforms/windows-common/ViewModelViewHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
// See the LICENSE file in the project root for full license information.

using System;
using System.Diagnostics.CodeAnalysis;
using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Reactive.Subjects;
using System.Windows;
using Splat;

#if NETFX_CORE
#if NETFX_CORE || HAS_UNO
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
#else
Expand All @@ -25,7 +26,13 @@ namespace ReactiveUI
/// the ViewModel property and display it. This control is very useful
/// inside a DataTemplate to display the View associated with a ViewModel.
/// </summary>
public class ViewModelViewHost : TransitioningContentControl, IViewFor, IEnableLogger, IDisposable
[SuppressMessage("Design", "CA1010:Collections should implement generic interface", Justification = "Deliberate usage")]
public class ViewModelViewHost : TransitioningContentControl, IViewFor, IEnableLogger
#if !HAS_UNO
#pragma warning disable SA1001 // Commas should be spaced correctly
, IDisposable
#pragma warning restore SA1001 // Commas should be spaced correctly
#endif
{
/// <summary>
/// The default content dependency property.
Expand Down