예제 #1
0
 /// <summary>
 /// Sets a custom shell for the WPF application
 /// </summary>
 /// <returns></returns>
 public static IApplicationBuilder UseCustomShellWithLogin <TShellViewModel, TLogin>(this IApplicationBuilder builder,
                                                                                     Action <Window> config = null)
     where TShellViewModel : IShellViewModel
     where TLogin : ILoginViewModel
 {
     builder.BuildActionsCoordinator.AddAction(DefaultBuildActions.ShellBuildAction((container) =>
     {
         var wpfApplication = container.Resolve <WPFApplication>();
         var shellViewModel = BuildCustomShell <TShellViewModel>(config, container);
         var loginViewModel = container.Resolve <TLogin>();
         BuildLogin(container, wpfApplication, shellViewModel, loginViewModel);
     }));
     return(builder);
 }
예제 #2
0
 /// <summary>
 /// Sets a custom shell for the WPF application
 /// </summary>
 /// <typeparam name="TShellViewModel"></typeparam>
 /// <returns></returns>
 public static IApplicationBuilder UseCustomShell <TShellViewModel>(this IApplicationBuilder builder,
                                                                    Action <Window> config = null)
     where TShellViewModel : IShellViewModel
 {
     builder.BuildActionsCoordinator.AddAction(DefaultBuildActions.ShellBuildAction((container) =>
     {
         var wpfApplication = container.Resolve <WPFApplication>();
         var shellViewModel = BuildCustomShell <TShellViewModel>(config, container);
         shellViewModel.Initialize().ContinueWith((t) =>
         {
             container.Resolve <IEventDispatcher>().GetEvent <ApplicationStartedEvent>().Raise(wpfApplication);
         });
         wpfApplication.ShowWindow();
     }));
     return(builder);
 }
예제 #3
0
 /// <summary>
 /// Sets a default shell for the WPF application
 /// </summary>
 /// <typeparam name="TContent">The main content type to be shown on startup</typeparam>
 /// <typeparam name="TLogin"></typeparam>
 /// <returns></returns>
 public static IApplicationBuilder UseDefaultShellWithLogin <TContent, TLogin>(
     this IApplicationBuilder builder,
     WindowState state      = WindowState.Maximized,
     Action <Window> config = null)
     where TContent : IPresentable
     where TLogin : ILoginViewModel
 {
     builder.BuildActionsCoordinator.AddAction(DefaultBuildActions.ShellBuildAction((container) =>
     {
         var wpfApplication = container.Resolve <WPFApplication>();
         var shellViewModel = BuildDefaultShell <TContent>(builder, state, config, container);
         var loginViewModel = container.Resolve <TLogin>();
         BuildLogin(container, wpfApplication, shellViewModel, loginViewModel);
     }));
     return(builder);
 }
예제 #4
0
 /// <summary>
 /// Sets a default shell for the WPF application
 /// </summary>
 /// <typeparam name="TContent">The main content type to be shown on startup</typeparam>
 /// <returns></returns>
 public static IApplicationBuilder UseDefaultShell <TContent>(
     this IApplicationBuilder builder,
     WindowState state      = WindowState.Maximized,
     Action <Window> config = null)
     where TContent : IPresentable
 {
     builder.BuildActionsCoordinator.AddAction(DefaultBuildActions.ShellBuildAction((container) =>
     {
         var wpfApplication = container.Resolve <WPFApplication>();
         var shellViewModel = BuildDefaultShell <TContent>(builder, state, config, container);
         shellViewModel.Initialize().ContinueWith((t) =>
         {
             container.Resolve <IEventDispatcher>().GetEvent <ApplicationStartedEvent>().Raise(wpfApplication);
         });
         wpfApplication.ShowWindow();
     }));
     return(builder);
 }