Skip to content

Commit 85cb45d

Browse files
mauroservientiradical-botrenovate-bot
authored
Backport the 4.0.0 milestone to 4.0 (#658)
* Update dependency dotnet-sdk to v10 (#614) Co-authored-by: Renovate <renovate@whitesourcesoftware.com> (cherry picked from commit 3f50dff) * Always on validation (#318) * Make sure NullValidationService is always suspended * Always enable validation by default * Use Array.Empty * Public API * force disable validation on tests * Skip property validation checks while validation is suspended With validation always enabled, the default NullValidationService is always suspended. Checking that first avoids the reflection-based SkipPropertyValidation lookup on every property change. (cherry picked from commit e3102b8) * Remove Repeat and make Wait internal (#648) Both have been obsolete since 2020. Repeat is unused, Wait is still used internally to delay region content loading. Closes #188 (cherry picked from commit 6ae7348) * Test that applications without a shell boot headless (#654) Booting without a shell, directly or through the Generic Host, must not show or set a main window, so that applications can start hidden, for example in the tray area. Closes #250 (cherry picked from commit 6f22fa2) * Remove the obsolete Expression-based overloads (#653) MoveFocusTo<T>(Expression) on both view model base classes and ObservableEntityCollection.OnPropertyChanged<TValue>(Expression) have been obsolete since 2020 in favor of their string overloads. Internal expression-based calls now use nameof too. Closes #140 Closes #177 (cherry picked from commit b1f09d0) * Remove the public DefaultViewDataContextSearchBehavior setter (#652) Nothing sets it, so it's always LocalOnly: the setter on IConventionsHandler is removed and the one on the default implementation is now private. Closes #310 (cherry picked from commit 0427dd4) * Drop DelegateValidationService (#651) It's unused, and the same behavior is a small AbstractValidationService subclass that overrides OnValidate. Closes #139 (cherry picked from commit 7c8ea14) * Drop the legacy schemas.topics.it XML namespaces (#650) The http://schemas.radicalframework.com namespaces replaced them in v2.0.0, when the legacy ones were deprecated. Closes #231 (cherry picked from commit 48c0442) * Make ApplicationBootstrapper obsolete with an error (#649) ApplicationBootstrapper has been obsolete with a warning since 2020. Using it is now a compile error pointing to RadicalApplication; it will be removed in v5.0.0. Its only test is covered by the equivalent RadicalApplication test. Closes #212 (cherry picked from commit c3ffb90) * Target .NET 10 .NET 8 support ends on November 10, 2026, leaving .NET 10 as the only supported runtime. Radical.Windows and its tests target net10.0-windows. This raises the minimum runtime consumers need, a breaking change for 4.0.0. Part of #642 (cherry picked from commit d693746) --------- Co-authored-by: Radical Bot User <radical@topics.it> Co-authored-by: Renovate <renovate@whitesourcesoftware.com>
1 parent 45395f9 commit 85cb45d

26 files changed

Lines changed: 99 additions & 285 deletions

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
- name: Setup .NET
4747
uses: actions/setup-dotnet@v5.0.0
4848
with:
49-
dotnet-version: 8.0.x
49+
dotnet-version: 10.0.x
5050
- name: Download artifacts
5151
uses: actions/download-artifact@v6.0.0
5252
with:

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
Radical framework is designed to help developing composite WPF applications based on the Model-View-ViewModel presentation pattern.
66

7+
Radical.Windows requires .NET 10 (`net10.0-windows`).
8+
79
[Documentation](http://docs.radicalframework.com/) is composed of articles and guidance detailing how to get the most out of Radical.
810

911
### Release

‎src/Radical.Windows.Tests/API/APIApprovals.Approve_API.approved.txt‎

Lines changed: 7 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@
99
[assembly: System.Windows.Markup.XmlnsDefinition("http://schemas.radicalframework.com/windows/input", "Radical.Windows.Input")]
1010
[assembly: System.Windows.Markup.XmlnsDefinition("http://schemas.radicalframework.com/windows/markup", "Radical.Windows.Markup")]
1111
[assembly: System.Windows.Markup.XmlnsDefinition("http://schemas.radicalframework.com/windows/regions", "Radical.Windows.Regions")]
12-
[assembly: System.Windows.Markup.XmlnsDefinition("http://schemas.topics.it/wpf/radical/windows", "Radical.Windows")]
13-
[assembly: System.Windows.Markup.XmlnsDefinition("http://schemas.topics.it/wpf/radical/windows/behaviors", "Radical.Windows.Behaviors")]
14-
[assembly: System.Windows.Markup.XmlnsDefinition("http://schemas.topics.it/wpf/radical/windows/controls", "Radical.Windows.Controls")]
15-
[assembly: System.Windows.Markup.XmlnsDefinition("http://schemas.topics.it/wpf/radical/windows/converters", "Radical.Windows.Converters")]
16-
[assembly: System.Windows.Markup.XmlnsDefinition("http://schemas.topics.it/wpf/radical/windows/effects", "Radical.Windows.Effects")]
17-
[assembly: System.Windows.Markup.XmlnsDefinition("http://schemas.topics.it/wpf/radical/windows/input", "Radical.Windows.Input")]
18-
[assembly: System.Windows.Markup.XmlnsDefinition("http://schemas.topics.it/wpf/radical/windows/markup", "Radical.Windows.Markup")]
19-
[assembly: System.Windows.Markup.XmlnsDefinition("http://schemas.topics.it/wpf/radical/windows/regions", "Radical.Windows.Regions")]
2012
namespace Microsoft.Extensions.Hosting
2113
{
2214
public static class HostBuilderExtensions
@@ -1898,9 +1890,8 @@ namespace Radical.Windows.Analytics
18981890
}
18991891
namespace Radical.Windows
19001892
{
1901-
[System.Obsolete("ApplicationBootstrapper has been obsoleted and will be treated as an error in v3." +
1902-
"0.0 and removed in v4.0.0. Consider moving to new RadicalApplication using the A" +
1903-
"ddRadicalApplication extension method.", false)]
1893+
[System.Obsolete("ApplicationBootstrapper has been obsoleted and will be removed in v5.0.0. Use Rad" +
1894+
"icalApplication, through the AddRadicalApplication extension method, instead.", true)]
19041895
public class ApplicationBootstrapper
19051896
{
19061897
public ApplicationBootstrapper() { }
@@ -1927,9 +1918,8 @@ namespace Radical.Windows
19271918
public Radical.Windows.ApplicationBootstrapper UsingAsShell<TShellType>()
19281919
where TShellType : System.Windows.Window { }
19291920
}
1930-
[System.Obsolete("ApplicationBootstrapper has been obsoleted and will be treated as an error in v3." +
1931-
"0.0 and removed in v4.0.0. Consider moving to new RadicalApplication using the A" +
1932-
"ddRadicalApplication extension method.", false)]
1921+
[System.Obsolete("ApplicationBootstrapper has been obsoleted and will be removed in v5.0.0. Use Rad" +
1922+
"icalApplication, through the AddRadicalApplication extension method, instead.", true)]
19331923
public class ApplicationBootstrapper<TMainView> : Radical.Windows.ApplicationBootstrapper
19341924
where TMainView : System.Windows.Window
19351925
{
@@ -1954,17 +1944,6 @@ namespace Radical.Windows
19541944
public void Boot() { }
19551945
public void Shutdown() { }
19561946
}
1957-
[System.Obsolete("Repeat has been obsoleted and will be removed in v3.0.0")]
1958-
public class Repeat
1959-
{
1960-
public Repeat() { }
1961-
public static Radical.Windows.Repeat.Repeater Every(System.TimeSpan delay) { }
1962-
public class Repeater
1963-
{
1964-
public void Stop() { }
1965-
public void This(System.Action action) { }
1966-
}
1967-
}
19681947
public static class VisualTreeCrawler
19691948
{
19701949
public static T FindChild<T>(this System.Windows.DependencyObject source)
@@ -1982,16 +1961,6 @@ namespace Radical.Windows
19821961
public static bool IsChildOfType<T>(System.Windows.DependencyObject obj)
19831962
where T : System.Windows.DependencyObject { }
19841963
}
1985-
[System.Obsolete("Wait has been obsoleted and will be removed in v3.0.0")]
1986-
public class Wait
1987-
{
1988-
public Wait() { }
1989-
public static Radical.Windows.Wait.Waiter For(System.TimeSpan delay) { }
1990-
public class Waiter
1991-
{
1992-
public void AndThen(System.Action action) { }
1993-
}
1994-
}
19951964
}
19961965
namespace Radical.Windows.Behaviors
19971966
{
@@ -2604,7 +2573,7 @@ namespace Radical.Windows.ComponentModel
26042573
[Radical.Windows.ComponentModel.IgnorePropertyInjectionAttribue]
26052574
System.Func<System.Windows.DependencyObject, System.Action<System.Windows.DependencyObject>, System.Windows.DependencyObject> DefaultTryHookClosedEventOfHostOf { get; }
26062575
[Radical.Windows.ComponentModel.IgnorePropertyInjectionAttribue]
2607-
Radical.Windows.ComponentModel.ViewDataContextSearchBehavior DefaultViewDataContextSearchBehavior { get; set; }
2576+
Radical.Windows.ComponentModel.ViewDataContextSearchBehavior DefaultViewDataContextSearchBehavior { get; }
26082577
[Radical.Windows.ComponentModel.IgnorePropertyInjectionAttribue]
26092578
System.Func<System.Windows.DependencyObject, Radical.Windows.ComponentModel.ViewDataContextSearchBehavior, bool> DefaultViewHasDataContext { get; }
26102579
[Radical.Windows.ComponentModel.IgnorePropertyInjectionAttribue]
@@ -3304,15 +3273,12 @@ namespace Radical.Windows.Model
33043273
protected override void OnInsertCompleted(int index, T value) { }
33053274
protected virtual void OnPropertyChanged(System.ComponentModel.PropertyChangedEventArgs e) { }
33063275
protected void OnPropertyChanged(string propertyName) { }
3307-
[System.Obsolete("This function has been obsoleted and will be removed in v3.0.0. Use OnPropertyCha" +
3308-
"nged(nameof(property)) instead")]
3309-
protected void OnPropertyChanged<TValue>(System.Linq.Expressions.Expression<System.Func<TValue>> property) { }
33103276
protected override void OnRemoveCompleted(T value, int index) { }
33113277
}
33123278
}
33133279
namespace Radical.Windows.Presentation
33143280
{
3315-
public abstract class AbstractMementoViewModel : Radical.Model.MementoEntity, Radical.Windows.ComponentModel.IViewModel, System.ComponentModel.INotifyPropertyChanged
3281+
public abstract class AbstractMementoViewModel : Radical.Model.MementoEntity, Radical.Windows.ComponentModel.IRequireValidation, Radical.Windows.ComponentModel.IViewModel, System.ComponentModel.INotifyDataErrorInfo, System.ComponentModel.INotifyPropertyChanged
33163282
{
33173283
protected AbstractMementoViewModel() { }
33183284
protected AbstractMementoViewModel(Radical.ComponentModel.ChangeTracking.ChangeTrackingRegistration registration) { }
@@ -3345,9 +3311,6 @@ namespace Radical.Windows.Presentation
33453311
public System.Collections.IEnumerable GetErrors(string propertyName) { }
33463312
protected string GetPropertyDisplayName(string propertyName) { }
33473313
protected virtual void MoveFocusTo(string focusedElementKey) { }
3348-
[System.Obsolete("This function has been obsoleted and will be removed in v3.0.0. Use MoveFocusTo(n" +
3349-
"ameof(property)) instead")]
3350-
protected virtual void MoveFocusTo<T>(System.Linq.Expressions.Expression<System.Func<T>> property) { }
33513314
protected virtual void OnAcceptingChanges(System.ComponentModel.CancelEventArgs e) { }
33523315
protected virtual void OnChangesAccepted() { }
33533316
protected virtual void OnChangesRejected() { }
@@ -3376,7 +3339,7 @@ namespace Radical.Windows.Presentation
33763339
"Errors"})]
33773340
protected virtual System.ValueTuple<bool, System.Collections.Generic.IEnumerable<Radical.Validation.ValidationError>> ValidateProperty(string propertyName, Radical.Windows.ComponentModel.ValidationBehavior behavior) { }
33783341
}
3379-
public abstract class AbstractViewModel : Radical.Model.Entity, Radical.Windows.ComponentModel.IViewModel, System.ComponentModel.INotifyPropertyChanged, System.ComponentModel.ISupportInitialize
3342+
public abstract class AbstractViewModel : Radical.Model.Entity, Radical.Windows.ComponentModel.IRequireValidation, Radical.Windows.ComponentModel.IViewModel, System.ComponentModel.INotifyDataErrorInfo, System.ComponentModel.INotifyPropertyChanged, System.ComponentModel.ISupportInitialize
33803343
{
33813344
protected AbstractViewModel() { }
33823345
protected Radical.Windows.ComponentModel.ValidationBehavior DefaultValidationBehavior { get; set; }
@@ -3408,9 +3371,6 @@ namespace Radical.Windows.Presentation
34083371
public System.Collections.IEnumerable GetErrors(string propertyName) { }
34093372
protected string GetPropertyDisplayName(string propertyName) { }
34103373
protected virtual void MoveFocusTo(string focusedElementKey) { }
3411-
[System.Obsolete("This function has been obsoleted and will be removed in v3.0.0. Use MoveFocusTo(n" +
3412-
"ameof(property)) instead")]
3413-
protected virtual void MoveFocusTo<T>(System.Linq.Expressions.Expression<System.Func<T>> property) { }
34143374
protected void OnErrorsChanged(string propertyName) { }
34153375
protected override void OnPropertyChanged(System.ComponentModel.PropertyChangedEventArgs e) { }
34163376
protected virtual void OnValidated() { }
@@ -3609,11 +3569,6 @@ namespace Radical.Windows.Validation
36093569
protected override System.Collections.Generic.IEnumerable<Radical.Validation.ValidationError> OnValidate() { }
36103570
protected override System.Collections.Generic.IEnumerable<Radical.Validation.ValidationError> OnValidateProperty(string propertyName) { }
36113571
}
3612-
public sealed class DelegateValidationService : Radical.Windows.Validation.AbstractValidationService
3613-
{
3614-
public DelegateValidationService(System.Func<System.Collections.Generic.IEnumerable<Radical.Validation.ValidationError>> validationCallback) { }
3615-
protected override System.Collections.Generic.IEnumerable<Radical.Validation.ValidationError> OnValidate() { }
3616-
}
36173572
public sealed class NullValidationService : Radical.Windows.Validation.AbstractValidationService
36183573
{
36193574
public static readonly Radical.Windows.ComponentModel.IValidationService Instance;

‎src/Radical.Windows.Tests/Boot/ApplicationBootstrapperTests.cs‎

Lines changed: 0 additions & 24 deletions
This file was deleted.

‎src/Radical.Windows.Tests/Boot/RadicalApplicationTests.cs‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,26 @@ public void ApplicationBoot_process_should_create_valid_container()
3030
Assert.IsTrue(bootCompleted);
3131
}
3232

33+
[SharedApplicationTestMethod]
34+
public void Application_without_a_shell_boots_without_showing_windows()
35+
{
36+
var bootCompleted = false;
37+
var mainWindowBeforeBoot = Application.Current.MainWindow;
38+
var windowsBeforeBoot = Application.Current.Windows.Count;
39+
40+
var radicalApplication = Application.Current.AddRadicalApplication(configuration =>
41+
{
42+
configuration.DisableAutoBoot();
43+
configuration.OnBootCompleted(_ => bootCompleted = true);
44+
});
45+
46+
radicalApplication.Boot();
47+
48+
Assert.IsTrue(bootCompleted);
49+
Assert.AreSame(mainWindowBeforeBoot, Application.Current.MainWindow);
50+
Assert.AreEqual(windowsBeforeBoot, Application.Current.Windows.Count);
51+
}
52+
3353
[SharedApplicationTestMethod]
3454
public void ApplicationBoot_process_should_allow_services_customization()
3555
{

‎src/Radical.Windows.Tests/Boot/RadicalApplicationTestsWithGenericHost.cs‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,32 @@ public async Task Application_can_boot_using_host_builder()
3838
}
3939
}
4040

41+
[SharedApplicationTestMethod]
42+
public async Task Application_without_a_shell_using_host_builder_boots_without_showing_windows()
43+
{
44+
var bootCompleted = false;
45+
var mainWindowBeforeBoot = Application.Current.MainWindow;
46+
var windowsBeforeBoot = Application.Current.Windows.Count;
47+
48+
var host = new HostBuilder()
49+
.AddRadicalApplication(configuration =>
50+
{
51+
configuration.OnBootCompleted(_ => bootCompleted = true);
52+
})
53+
.Build();
54+
55+
await host.StartAsync();
56+
57+
Assert.IsTrue(bootCompleted);
58+
Assert.AreSame(mainWindowBeforeBoot, Application.Current.MainWindow);
59+
Assert.AreEqual(windowsBeforeBoot, Application.Current.Windows.Count);
60+
61+
using (host)
62+
{
63+
await host.StopAsync();
64+
}
65+
}
66+
4167
[SharedApplicationTestMethod]
4268
public async Task Application_using_host_builder_can_resolve_configured_services()
4369
{

‎src/Radical.Windows.Tests/Presentation/AbstractMementoViewModelTests.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ public void AbstractMementoViewModel_PropertyChanged_is_raised_GetErrors_should_
255255
};
256256

257257
sut.ValidateUsing(
258-
new DataAnnotationValidationService<SampleTestMementoViewModel>(sut));
258+
new DataAnnotationValidationService<SampleTestMementoViewModel>(sut), false);
259259
sut.NotNullNotEmpty = "";
260260

261261
Assert.IsNotNull(errors);

‎src/Radical.Windows.Tests/Presentation/AbstractViewModelTests.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ public void AbstractViewModel_PropertyChanged_is_raised_GetErrors_should_contain
189189
};
190190

191191
sut.ValidateUsing(
192-
new DataAnnotationValidationService<SampleTestViewModel>(sut));
192+
new DataAnnotationValidationService<SampleTestViewModel>(sut), false);
193193
sut.NotNullNotEmpty = "";
194194

195195
Assert.IsNotNull(errors);

‎src/Radical.Windows.Tests/Radical.Windows.Tests.csproj‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0-windows;net10.0-windows</TargetFrameworks>
4+
<TargetFramework>net10.0-windows</TargetFramework>
55
<UseWPF>true</UseWPF>
66
</PropertyGroup>
77

‎src/Radical.Windows/ApplicationBootstrapper(generic).cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace Radical.Windows
66
/// An <see cref="ApplicationBootstrapper"/> that uses <typeparamref name="TMainView"/> as the shell window.
77
/// </summary>
88
/// <typeparam name="TMainView">The type of the shell window.</typeparam>
9-
[Obsolete("ApplicationBootstrapper has been obsoleted and will be treated as an error in v3.0.0 and removed in v4.0.0. Consider moving to new RadicalApplication using the AddRadicalApplication extension method.", false)]
9+
[Obsolete("ApplicationBootstrapper has been obsoleted and will be removed in v5.0.0. Use RadicalApplication, through the AddRadicalApplication extension method, instead.", true)]
1010
public class ApplicationBootstrapper<TMainView> : ApplicationBootstrapper where TMainView : System.Windows.Window
1111
{
1212
/// <summary>

0 commit comments

Comments
 (0)