Task IHandleAsync <LoadEventModel> .HandleAsync(LoadEventModel message) { GamePackageViewModelBinder.ManuelElements.Clear(); //often times i have to add manually. SkipboSaveInfo save = cons !.Resolve <SkipboSaveInfo>(); //usually needs this part for multiplayer games. _score !.LoadLists(save.PlayerList); _playerHandWPF !.LoadList(_model.PlayerHand1 !, ""); // i think _deckGPile !.Init(_model.Deck1 !, ""); // try here. may have to do something else as well (?) _deckGPile.StartListeningMainDeck(); _publicGraphics !.Init(_model.PublicPiles !, ""); // i think _publicGraphics.StartAnimationListener("public"); return(this.RefreshBindingsAsync(_aggregator)); }
public SkipboMainView(IEventAggregator aggregator, TestOptions test, SkipboVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _deckGPile = new BaseDeckXF <SkipboCardInformation, SkipboGraphicsCP, CardGraphicsXF>(); _score = new ScoreBoardXF(); _playerHandWPF = new BaseHandXF <SkipboCardInformation, SkipboGraphicsCP, CardGraphicsXF>(); _publicGraphics = new BasicMultiplePilesXF <SkipboCardInformation, SkipboGraphicsCP, CardGraphicsXF>(); StackLayout mainStack = new StackLayout(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer(nameof(SkipboMainViewModel.RestoreScreen)); } StackLayout otherStack = new StackLayout(); otherStack.Orientation = StackOrientation.Horizontal; otherStack.Children.Add(_deckGPile); otherStack.Children.Add(_publicGraphics); mainStack.Children.Add(otherStack); _score.AddColumn("In Stock", false, nameof(SkipboPlayerItem.InStock)); int x; for (x = 1; x <= 4; x++) //has to change for flinch. { var thisStr = "Discard" + x; _score.AddColumn(thisStr, false, thisStr); } _score.AddColumn("Stock Left", false, nameof(SkipboPlayerItem.StockLeft)); _score.AddColumn("Cards Left", false, nameof(SkipboPlayerItem.ObjectCount)); //very common. SimpleLabelGridXF firstInfo = new SimpleLabelGridXF(); firstInfo.AddRow("RS Cards", nameof(SkipboMainViewModel.CardsToShuffle)); firstInfo.AddRow("Turn", nameof(SkipboMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(SkipboMainViewModel.Status)); mainStack.Children.Add(_playerHandWPF); ParentSingleUIContainer parent = new ParentSingleUIContainer(nameof(SkipboMainViewModel.PlayerPilesScreen)); mainStack.Children.Add(parent); mainStack.Children.Add(firstInfo.GetContent); mainStack.Children.Add(_score); _deckGPile.Margin = new Thickness(5, 5, 5, 5); if (restoreP != null) { mainStack.Children.Add(restoreP); //default add to grid but does not have to. } GamePackageViewModelBinder.ManuelElements.Clear(); //often times i have to add manually. SkipboSaveInfo save = cons !.Resolve <SkipboSaveInfo>(); //usually needs this part for multiplayer games. _score !.LoadLists(save.PlayerList); _playerHandWPF !.LoadList(_model.PlayerHand1 !, ""); // i think _deckGPile !.Init(_model.Deck1 !, ""); // try here. may have to do something else as well (?) _deckGPile.StartListeningMainDeck(); _publicGraphics !.Init(_model.PublicPiles !, ""); // i think _publicGraphics.StartAnimationListener("public"); Content = mainStack; }