private static void ConfigureDefaultViewModelSelector(WebAssemblyHostBuilder builder)
        {
            ViewModelComponentSelector viewModelComponentSelector = new ViewModelComponentSelector();

            viewModelComponentSelector.RegisterDefaults();
            viewModelComponentSelector.RegisterView <NavItem, NavItemView>();
            viewModelComponentSelector.RegisterView <NavigationView, NavMenu>();
            viewModelComponentSelector.RegisterView <ApplicationView, ApplicationViewLayout>("ApplicationView");
            builder.Services.AddScoped <IViewSelector>(sp => viewModelComponentSelector);
        }
Exemple #2
0
 public static void AddToastServices(this IServiceCollection services)
 {
     services.AddScoped <IViewSelector>(sp =>
     {
         var viewModelComponentSelector = new ViewModelComponentSelector();
         viewModelComponentSelector.RegisterDefaults();
         viewModelComponentSelector.RegisterView <ToastModel, ToastView>();
         return(viewModelComponentSelector);
     });
     services.AddScoped <IDateTimeBroker, DateTimeBroker>();
     services.AddScoped <ISynchronisationService, SynchronisationService>();
     services.AddScoped <IToastService, ToastService>();
 }