Skip to content
Navigation Menu
{{ message }}
-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feature: Added Uno support #2067
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
0c38232
Added wasm files.
weitzhandler bee2b58
Fixed ReactivePage.OnViewModelChanging implementation
weitzhandler 08a8c04
Merge branch 'master' into master
glennawatson 7bbab71
Merge branch 'master' into master
glennawatson ea5fd6c
Merge branch 'master' into master
glennawatson 009d692
Added Uno platform initial support
weitzhandler 21ae794
Fixed linked files references
weitzhandler 5f788b6
Merge branch 'master' into master
weitzhandler 99e1f39
Fix wrong preprocessor directive
weitzhandler 10ee94a
Merge branch 'master' of https://github.com/weitzhandler/ReactiveUI
weitzhandler c284a5e
Fixes
glennawatson fc9e3bc
Updated message suppression
weitzhandler 3472b76
Expanded suppression messages
weitzhandler 780abf2
Deleting g.cs file manually
weitzhandler 684c979
extensions for reactiveui
ghuntley ba00181
Remove HAS_UNO directive from production
weitzhandler 7497685
Updated Uno Platform brand name
weitzhandler 36bdda5
Updated Reactive.Wasm to the new NuGet package
weitzhandler bf55094
further work
glennawatson d20cb8e
merge
glennawatson 0e3932c
Add back in the ReactivePage.cs
glennawatson 14ea219
remove the reactive page since that will be added to the windows-comm…
glennawatson 1bcfb19
Merge branch 'master' into master
glennawatson 335034d
Add Uno to RxUI initialization
weitzhandler 9f064fb
Added some README stuff about Uno
weitzhandler a1db0c2
Update README.md
weitzhandler 0973481
Merge branch 'master' into master
glennawatson fe9c1c7
Reverted README changes
weitzhandler d774634
Merge branch 'master' into master
glennawatson 8b637b0
Merge branch 'master' into master
glennawatson aaf53e7
adding results to parent directories
glennawatson f6148b7
Further work on getting uno in
glennawatson 214b5a8
Remove the events project, will be back in another iteration
glennawatson a25e37f
turn off exception when in WASM mode
glennawatson 0df2271
grouped registrations
RLittlesII File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Further work on getting uno in
- Loading branch information
commit f6148b75aca56dc7d32dea80f100cdb479ef46d6
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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. | ||
|
|
||
| // <auto-generated /> | ||
|
|
||
| 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 | ||
| { | ||
| /// <summary> | ||
| /// Represents an object that schedules units of work on a <see cref="CoreDispatcher"/>. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// This scheduler type is typically used indirectly through the <see cref="Linq.DispatcherObservable.ObserveOnDispatcher{TSource}(IObservable{TSource})"/> and <see cref="Linq.DispatcherObservable.SubscribeOnDispatcher{TSource}(IObservable{TSource})"/> methods that use the current Dispatcher. | ||
| /// </remarks> | ||
| [CLSCompliant(false)] | ||
| public sealed class CoreDispatcherScheduler : LocalScheduler, ISchedulerPeriodic | ||
| { | ||
| /// <summary> | ||
| /// Constructs a <see cref="CoreDispatcherScheduler"/> that schedules units of work on the given <see cref="CoreDispatcher"/>. | ||
| /// </summary> | ||
| /// <param name="dispatcher">Dispatcher to schedule work on.</param> | ||
| /// <exception cref="ArgumentNullException"><paramref name="dispatcher"/> is <c>null</c>.</exception> | ||
| public CoreDispatcherScheduler(CoreDispatcher dispatcher) | ||
| { | ||
| Dispatcher = dispatcher ?? throw new ArgumentNullException(nameof(dispatcher)); | ||
| Priority = CoreDispatcherPriority.Normal; | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Constructs a <see cref="CoreDispatcherScheduler"/> that schedules units of work on the given <see cref="CoreDispatcher"/> with the given priority. | ||
| /// </summary> | ||
| /// <param name="dispatcher">Dispatcher to schedule work on.</param> | ||
| /// <param name="priority">Priority for scheduled units of work.</param> | ||
| /// <exception cref="ArgumentNullException"><paramref name="dispatcher"/> is <c>null</c>.</exception> | ||
| public CoreDispatcherScheduler(CoreDispatcher dispatcher, CoreDispatcherPriority priority) | ||
| { | ||
| Dispatcher = dispatcher ?? throw new ArgumentNullException(nameof(dispatcher)); | ||
| Priority = priority; | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Gets the scheduler that schedules work on the <see cref="CoreDispatcher"/> associated with the current Window. | ||
| /// </summary> | ||
| 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); | ||
| } | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Gets the <see cref="CoreDispatcher"/> associated with the <see cref="CoreDispatcherScheduler"/>. | ||
| /// </summary> | ||
| public CoreDispatcher Dispatcher { get; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the priority at which work is scheduled. | ||
| /// </summary> | ||
| public CoreDispatcherPriority Priority { get; } | ||
|
|
||
| /// <summary> | ||
| /// Schedules an action to be executed on the dispatcher. | ||
| /// </summary> | ||
| /// <typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> | ||
| /// <param name="state">State passed to the action to be executed.</param> | ||
| /// <param name="action">Action to be executed.</param> | ||
| /// <returns>The disposable object used to cancel the scheduled action (best effort).</returns> | ||
| /// <exception cref="ArgumentNullException"><paramref name="action"/> is <c>null</c>.</exception> | ||
| public override IDisposable Schedule<TState>(TState state, Func<IScheduler, TState, IDisposable> 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()) | ||
| ); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Schedules an action to be executed after <paramref name="dueTime"/> on the dispatcher, using a <see cref="DispatcherTimer"/> object. | ||
| /// </summary> | ||
| /// <typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> | ||
| /// <param name="state">State passed to the action to be executed.</param> | ||
| /// <param name="action">Action to be executed.</param> | ||
| /// <param name="dueTime">Relative time after which to execute the action.</param> | ||
| /// <returns>The disposable object used to cancel the scheduled action (best effort).</returns> | ||
| /// <exception cref="ArgumentNullException"><paramref name="action"/> is <c>null</c>.</exception> | ||
| public override IDisposable Schedule<TState>(TState state, TimeSpan dueTime, Func<IScheduler, TState, IDisposable> 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>(TState state, TimeSpan dueTime, Func<IScheduler, TState, IDisposable> 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; | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Schedules a periodic piece of work on the dispatcher, using a <see cref="DispatcherTimer"/> object. | ||
| /// </summary> | ||
| /// <typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> | ||
| /// <param name="state">Initial state passed to the action upon the first iteration.</param> | ||
| /// <param name="period">Period for running the work periodically.</param> | ||
| /// <param name="action">Action to be executed, potentially updating the state.</param> | ||
| /// <returns>The disposable object used to cancel the scheduled recurring action (best effort).</returns> | ||
| /// <exception cref="ArgumentNullException"><paramref name="action"/> is <c>null</c>.</exception> | ||
| /// <exception cref="ArgumentOutOfRangeException"><paramref name="period"/> is less than <see cref="TimeSpan.Zero"/>.</exception> | ||
| public IDisposable SchedulePeriodic<TState>(TState state, TimeSpan period, Func<TState, TState> 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 = _ => _; | ||
| } | ||
| }); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
You can’t perform that action at this time.

Uh oh!
There was an error while loading. Please reload this page.