forked from reactiveui/ReactiveUI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRegistrations.cs
More file actions
30 lines (25 loc) · 1.28 KB
/
Registrations.cs
File metadata and controls
30 lines (25 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MS-PL license.
// See the LICENSE file in the project root for more information.
using Splat;
using System;
using System.Reactive.Concurrency;
using System.Windows.Forms;
namespace ReactiveUI.Winforms
{
public class Registrations : IWantsToRegisterStuff
{
public void Register(Action<Func<object>, Type> registerFunction)
{
registerFunction(() => new PlatformOperations(), typeof(IPlatformOperations));
registerFunction(() => new ComponentModelTypeConverter(), typeof(IBindingTypeConverter));
registerFunction(() => new CreatesWinformsCommandBinding(), typeof(ICreatesCommandBinding));
registerFunction(() => new WinformsCreatesObservableForProperty(), typeof(ICreatesObservableForProperty));
registerFunction(() => new ActivationForViewFetcher(), typeof(IActivationForViewFetcher));
if (!ModeDetector.InUnitTestRunner()) {
WindowsFormsSynchronizationContext.AutoInstall = true;
RxApp.MainThreadScheduler = new WaitForDispatcherScheduler(() => new SynchronizationContextScheduler(new WindowsFormsSynchronizationContext()));
}
}
}
}