private void SelectOneMockParticipant(RosterExplorerViewModel rosterVM) { var selectedMemList = new List <CharacterCrowdMember>(); selectedMemList.Add(TestObjectsFactory.MockCharacterCrowdMember); rosterVM.SelectedParticipants = selectedMemList; }
public HeroVirtualTabletopMainViewModelImpl(IEventAggregator eventAggregator, CrowdMemberExplorerViewModel crowdMemberExplorerViewModel, RosterExplorerViewModel rosterExplorerViewModel, CharacterEditorViewModel characterEditorViewModel, IdentityEditorViewModel identityEditorViewModel, AbilityEditorViewModel abilityEditorViewModel, MovementEditorViewModel movementEditorViewModel, ActiveCharacterWidgetViewModel activeCharacterWidgetViewModel, AttackConfigurationWidgetViewModel attackConfigurationWidgetViewModel, PopupService popupService, IconInteractionUtility iconInteractionUtility, DesktopContextMenu desktopContextMenu, Camera camera) { this.eventAggregator = eventAggregator; this.CrowdMemberExplorerViewModel = crowdMemberExplorerViewModel; this.RosterExplorerViewModel = rosterExplorerViewModel; this.CharacterEditorViewModel = characterEditorViewModel; this.IdentityEditorViewModel = identityEditorViewModel; this.AbilityEditorViewModel = abilityEditorViewModel; this.MovementEditorViewModel = movementEditorViewModel; this.ActiveCharacterWidgetViewModel = activeCharacterWidgetViewModel; this.AttackConfigurationWidgetViewModel = attackConfigurationWidgetViewModel; this.iconInteractionUtility = iconInteractionUtility; this.camera = camera; this.popupService = popupService; this.desktopContextMenu = desktopContextMenu; RegisterPopups(); gameInitializeTimer = new System.Threading.Timer(gameInitializeTimer_Callback, null, System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite); LaunchGame(); this.eventAggregator.Subscribe(this); //this.eventAggregator.GetEvent<AddToRosterEvent>().Subscribe((IEnumerable<CrowdMemberModel> models) => { this.IsRosterExplorerExpanded = true; }); //this.eventAggregator.GetEvent<EditCharacterEvent>().Subscribe((Tuple<ICrowdMemberModel, IEnumerable<ICrowdMemberModel>> tuple) => { this.IsCharacterEditorExpanded = true; }); //this.eventAggregator.GetEvent<EditIdentityEvent>().Subscribe((Tuple<Identity, Character> tuple) => { this.IsIdentityEditorExpanded = true; }); //this.eventAggregator.GetEvent<EditAbilityEvent>().Subscribe((Tuple<AnimatedAbility, Character> tuple) => { this.IsAbilityEditorExpanded = true; }); //this.eventAggregator.GetEvent<EditMovementEvent>().Subscribe((CharacterMovement cm) => { this.IsMovementEditorExpanded = true; }); //this.eventAggregator.GetEvent<CreateCrowdFromModelsEvent>().Subscribe((CrowdModel crowd) => { this.IsCrowdFromModelsExpanded = true; }); //this.eventAggregator.GetEvent<AttackInitiatedEvent>().Subscribe((Tuple<Character, Attack> tuple) => { this.IsRosterExplorerExpanded = true; }); }
public void TestInitialize() { InitializeDefaultList(); InitializeCrowdRepositoryMockWithDefaultList(); this.numberOfItemsFound = 0; rosterExplorerViewModel = new RosterExplorerViewModel(busyServiceMock.Object, unityContainerMock.Object, messageBoxServiceMock.Object, targetObserverMock.Object, eventAggregatorMock.Object); }
public RosterExplorerView(RosterExplorerViewModel viewModel) { InitializeComponent(); this.viewModel = viewModel; this.DataContext = this.viewModel; this.RosterViewListBox.SelectAll(); this.RosterViewListBox.UnselectAll(); notifier = new Notifier(cfg => { cfg.PositionProvider = new WindowPositionProvider( parentWindow: Application.Current.MainWindow, corner: Corner.TopRight, offsetX: 10, offsetY: 10); cfg.LifetimeSupervisor = new TimeAndCountBasedLifetimeSupervisor( notificationLifetime: TimeSpan.FromSeconds(4), maximumNotificationCount: MaximumNotificationCount.FromCount(1)); cfg.Dispatcher = Application.Current.Dispatcher; cfg.DisplayOptions.TopMost = false; cfg.DisplayOptions.Width = 250; }); notifier.ClearMessages(); clickTimer.Interval = 10; clickTimer.Tick += new EventHandler(clickTimer_Tick); this.viewModel.RosterMemberAdded += this.viewModel_RosterMemberAdded; this.viewModel.SequenceUpdated += this.viewModel_SequenceUpdated; this.viewModel.ShowNotification += this.ViewModel_ShowNotification; }