Upgraded to Avalonia 11.3.7; added dependency injector bindings for the common dialog service

This commit is contained in:
Markus Ewald 2025-10-22 15:52:16 +02:00
parent 74b4625e55
commit ffa8275fb6
2 changed files with 17 additions and 2 deletions

View file

@ -18,7 +18,6 @@ limitations under the License.
#endregion // Apache License 2.0
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
@ -45,4 +44,4 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.3.3")]
[assembly: AssemblyVersion("1.4.0")]

View file

@ -22,6 +22,7 @@ using System;
using Microsoft.Extensions.DependencyInjection;
using Nuclex.Avalonia.AutoBinding;
using Nuclex.Avalonia.CommonDialogs;
using Nuclex.Avalonia.Messages;
namespace Nuclex.Avalonia.DependencyInjection {
@ -60,6 +61,21 @@ namespace Nuclex.Avalonia.DependencyInjection {
// with button controls.
services.AddSingleton<IAutoBinder, ConventionBinder>();
// The file dialogs are Avalonia's variant of the standard file and directory
// picker dialogs, designed to be able to work on classic desktop platforms with
// a user-facing file system as well as on app store and web applications where
// local file storage may need to go through custom platform-specific APIs.
services.AddSingleton<AvaloniaFileDialogs>();
// Provide the file and directory picker services tjhrough our AvaloniaFileDialogs
// service which handles both implementations.
services.AddSingleton<IFilePickerService>(
sp => sp.GetRequiredService<AvaloniaFileDialogs>()
);
services.AddSingleton<IDirectoryPickerService>(
sp => sp.GetRequiredService<AvaloniaFileDialogs>()
);
return services;
}