/// <summary> /// Initializes a new instance of the <see cref="MainWindow"/> class. /// </summary> public MainWindow() { InitializeComponent(); try { var composer = new DependencyComposer(); composer.ComposeExportedValue <IDependencyComposer>(composer); _mainWindowVM = composer.GetExportedValue <IMainWindowVM>(); DataContext = _mainWindowVM; _mainWindowVM.Initialize(); _mainWindowVM.CloseRequest += MainWindowVMCloseRequest; } catch (Exception e) { Console.WriteLine(e); throw; } }
/// <summary> /// Initializes a new instance of the <see cref="MainWindow"/> class. /// </summary> public MainWindow() { InitializeComponent(); try { var composer = new DependencyComposer(); composer.ComposeExportedValue<IDependencyComposer>(composer); _mainWindowVM = composer.GetExportedValue<IMainWindowVM>(); DataContext = _mainWindowVM; _mainWindowVM.Initialize(); _mainWindowVM.CloseRequest += MainWindowVMCloseRequest; } catch (Exception e) { Console.WriteLine(e); throw; } }
protected override void OnActivated(System.EventArgs e) { _mainWindowVM.Initialize(); base.OnActivated(e); }
public void ShouldInitializeMenuWhenInitializing() { _objectUnderTest.Initialize(); _menuVMMock.Verify(p => p.Initialize()); }