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

Update WinForms to remove ControlObservable #3964

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// 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.Windows.Forms;

namespace ReactiveUI.Tests.Winforms;

/// <summary>
Expand Down
11 changes: 3 additions & 8 deletions src/ReactiveUI.Winforms/ActivationForViewFetcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

using System.Globalization;
using System.Reflection;
using System.Windows.Forms;

namespace ReactiveUI.Winforms;

Expand Down Expand Up @@ -87,17 +86,13 @@ public IObservable<bool> GetActivationForView(IActivatableView view)
return Observable<bool>.Empty;
}

private static bool GetIsDesignMode(Control control)
{
var isDesignMode = LicenseManager.UsageMode == LicenseUsageMode.Designtime || control.Site?.DesignMode == true || control.Parent?.Site?.DesignMode == true;

return isDesignMode;
}
private static bool GetIsDesignMode(Control control) =>
LicenseManager.UsageMode == LicenseUsageMode.Designtime || control.Site?.DesignMode == true || control.Parent?.Site?.DesignMode == true;

private bool GetCachedIsDesignMode(Control control)
{
_isDesignModeCache ??= GetIsDesignMode(control);

return _isDesignModeCache.Value;
}
}
}
4 changes: 1 addition & 3 deletions src/ReactiveUI.Winforms/ContentControlBindingHook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
// 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.Windows.Forms;

namespace ReactiveUI.Winforms;

/// <summary>
Expand Down Expand Up @@ -37,4 +35,4 @@ public bool ExecuteHook(object? source, object target, Func<IObservedChange<obje

return true;
}
}
}
1 change: 0 additions & 1 deletion src/ReactiveUI.Winforms/CreatesWinformsCommandBinding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
// See the LICENSE file in the project root for full license information.

using System.Reflection;
using System.Windows.Forms;
using System.Windows.Input;

namespace ReactiveUI.Winforms;
Expand Down
1 change: 1 addition & 0 deletions src/ReactiveUI.Winforms/GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
global using System.Reactive.Disposables;
global using System.Reactive.Linq;
global using System.Threading;
global using System.Windows.Forms;
global using Splat;
2 changes: 0 additions & 2 deletions src/ReactiveUI.Winforms/PanelSetMethodBindingConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
// 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.Windows.Forms;

namespace ReactiveUI.Winforms;

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/ReactiveUI.Winforms/ReactiveUI.Winforms.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</ItemGroup>

<ItemGroup>
<Compile Include="..\ReactiveUI.Wpf\Rx\**\*.cs" LinkBase="Rx" Exclude="..\ReactiveUI.Wpf\Rx\**\Dispatcher*.cs;..\ReactiveUI.Wpf\Rx\Internal\*.cs;..\ReactiveUI.Wpf\Rx\Concurrency\*.cs" />
<Compile Include="..\ReactiveUI.Wpf\Rx\**\*.cs" LinkBase="Rx" Exclude="..\ReactiveUI.Wpf\Rx\**\Dispatcher*.cs;..\ReactiveUI.Wpf\Rx\Internal\*.cs;..\ReactiveUI.Wpf\Rx\Concurrency\*.cs;..\ReactiveUI.Wpf\Rx\Linq\ControlObservable.cs" />
</ItemGroup>

<ItemGroup Condition="$(TargetFramework) == 'net462' or $(TargetFramework.EndsWith('-windows10.0.17763.0'))">
Expand Down
4 changes: 1 addition & 3 deletions src/ReactiveUI.Winforms/ReactiveUserControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
// 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.Windows.Forms;

namespace ReactiveUI.Winforms;

/// <summary>
Expand Down Expand Up @@ -49,4 +47,4 @@ protected override void Dispose(bool disposing)

base.Dispose(disposing);
}
}
}
2 changes: 0 additions & 2 deletions src/ReactiveUI.Winforms/ReactiveUserControlNonGeneric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
// 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.Windows.Forms;

namespace ReactiveUI.Winforms;

/// <summary>
Expand Down
2 changes: 0 additions & 2 deletions src/ReactiveUI.Winforms/Registrations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
// 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.Windows.Forms;

namespace ReactiveUI.Winforms;

/// <summary>
Expand Down
2 changes: 0 additions & 2 deletions src/ReactiveUI.Winforms/RoutedViewHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
// 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.Windows.Forms;

namespace ReactiveUI.Winforms;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
// 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.Windows.Forms;

namespace ReactiveUI.Winforms;

/// <summary>
Expand Down
2 changes: 0 additions & 2 deletions src/ReactiveUI.Winforms/ViewModelViewHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
// 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.Windows.Forms;

namespace ReactiveUI.Winforms;

/// <summary>
Expand Down
Loading