コード例 #1
0
 /// <summary>
 /// Add singleton view model type to service registry.
 /// </summary>
 /// <typeparam name="T">view model type</typeparam>
 /// <param name="serviceRegistry">service registry</param>
 /// <returns>service registry</returns>
 public static IServiceRegistry AddViewModelSingleton <T>(this IServiceRegistry serviceRegistry) where T : BaseViewModel
 {
     return(serviceRegistry.AddSingleton <T>());
 }
コード例 #2
0
 /// <summary>
 /// Add the event service to the service registry.
 /// </summary>
 /// <param name="serviceRegistry"></param>
 /// <returns></returns>
 public static IServiceRegistry AddEventService(this IServiceRegistry serviceRegistry)
 {
     serviceRegistry.AddSingleton <IEventService, EventService>();
     return(serviceRegistry);
 }
コード例 #3
0
 /// <summary>
 /// Register service as a singleton.
 /// </summary>
 /// <typeparam name="TService">service type</typeparam>
 /// <returns>service registry</returns>
 public IServiceRegistry AddSingleton <TService>() where TService : class
 {
     return(_serviceRegistry.AddSingleton <TService>());
 }
コード例 #4
0
 /// <summary>
 /// Add the property service to the service registry.
 /// </summary>
 /// <param name="serviceRegistry"></param>
 /// <returns></returns>
 public static IServiceRegistry AddDictionaryService(this IServiceRegistry serviceRegistry)
 {
     serviceRegistry.AddSingleton <IDictionaryService>(x => DictionaryService.Current);
     return(serviceRegistry);
 }
コード例 #5
0
ファイル: MainActivity.cs プロジェクト: cwaldron/CafeSamples
 public void Configure(IServiceRegistry registry)
 {
     registry.AddSingleton <IAudioService, AudioService>();
 }