Inheritance: System.Windows.FrameworkElement
コード例 #1
0
 public void AutoRegister()
 {
     mediatorMap.MapView( typeof(ViewComponent), typeof(ViewMediator), null, true, true );
     ViewComponent viewComponent = new ViewComponent();
     contextView.Children.Add( viewComponent );
     Assert.IsTrue( mediatorMap.HasMediatorForView(viewComponent ), "Mediator should have been created for View Component" );
 }
コード例 #2
0
 public void UnmapView()
 {
     mediatorMap.MapView( typeof(ViewComponent), typeof(ViewMediator) );
     mediatorMap.UnmapView( typeof(ViewComponent) );
     ViewComponent viewComponent = new ViewComponent();
     contextView.Children.Add( viewComponent );
     bool hasMediator = mediatorMap.HasMediatorForView( viewComponent );
     Assert.IsFalse( hasMediator, "Mediator should NOT have been created for View Component" );
 }
コード例 #3
0
 public void MediatorIsMappedAndCreatedForView()
 {
     mediatorMap.MapView( typeof(ViewComponent), typeof(ViewMediator), null, false, false );
     ViewComponent viewComponent = new ViewComponent();
     contextView.Children.Add( viewComponent );
     IMediator mediator = mediatorMap.CreateMediator( viewComponent );
     Assert.IsNotNull( mediator, "Mediator should have been created " );
     Assert.IsTrue( mediatorMap.HasMediatorForView(viewComponent ), "Mediator should have been created for View Component" );
 }