Task IHandleAsync <LoadEventModel> .HandleAsync(LoadEventModel message) { //if i have to clear and manually add controls, will do. not sure if we have to add controls manually or not. GamePackageViewModelBinder.ManuelElements.Clear(); BingoSaveInfo thisSave = cons !.Resolve <BingoSaveInfo>(); //usually needs this part for multiplayer games. _board !.CreateControls(thisSave.BingoBoard); return(this.RefreshBindingsAsync(_aggregator)); }
public BingoMainView(IEventAggregator aggregator, TestOptions test, BingoSaveInfo saveInfo ) { _aggregator = aggregator; _aggregator.Subscribe(this); StackLayout mainStack = new StackLayout(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer(nameof(BingoMainViewModel.RestoreScreen)); } _board.Margin = new Thickness(5); SimpleLabelGridXF secondInfo = new SimpleLabelGridXF(); secondInfo.FontSize = 30; secondInfo.AddRow("Number Called", nameof(BingoMainViewModel.NumberCalled)); mainStack.Children.Add(secondInfo.GetContent); mainStack.Children.Add(_board); SimpleLabelGridXF firstInfo = new SimpleLabelGridXF(); firstInfo.AddRow("Status", nameof(BingoMainViewModel.Status)); mainStack.Children.Add(firstInfo.GetContent); var endButton = GetGamingButton("Bingo", nameof(BingoMainViewModel.BingoAsync)); // its bingo instead. endButton.HorizontalOptions = LayoutOptions.Start; mainStack.Children.Add(endButton); 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. _board !.CreateControls(saveInfo.BingoBoard); Content = mainStack; }