✅ how to pass username?
in my HomeScreenView.axaml file I have
When a player clicks the New Game button, how can I pass the username back to the parent file MainWindowViewModel.cs
I need to pass this username to the
NewGameViewModel();
so that as the player plays the game, it can store the username along with the game results.4 Replies
would the simple solution be to pass it as a command paremeter through the button?
it doesnt sound like that should be the responsibility of the root viewmodel
ok. I moved the new game and previous games functions to the HomeScreenViewModel file, and when I run my program, I get this error message merged in with my textbox. I'm not sure how to fix this, honestly.
I'm trying to build it like I did my diary app. I was told that the MainWindow.xxxx files are supposed to hand the screen changes, so I'm trying to model after that
I think I've done this wrong, tbh. I'm going to start over.
so since the json file will only be used to add new games (when they end) and show previous games when that button is clicked on the home screen, do I need to pass the database through the app.axaml.cs file through to MainWindowViewModel? https://github.com/mekasu0124/PhasmoTrivia