Upgraded to Avalonia 11.3.7; added dependency injector bindings for the common dialog service
This commit is contained in:
		
							parent
							
								
									74b4625e55
								
							
						
					
					
						commit
						ffa8275fb6
					
				
					 2 changed files with 17 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -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;
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue