public QuestionsViewModel(Questions questions) { if (questions == null) { throw new NullReferenceException("questions"); } this.questions = questions; }
public MainWindow() { InitializeComponent(); Game game = new Game(); StartViewModel startViewModel = new StartViewModel(game); startViewModel.CurrentGame = game; this.DataContext = startViewModel; GameViewModel gameViewModel = new GameViewModel(game); this.GameView.DataContext = gameViewModel; this.CategoryView.DataContext = gameViewModel; Questions questions = new Questions(); QuestionsViewModel questionsViewModel = new QuestionsViewModel(questions); this.QuestionsView.DataContext = questionsViewModel; this.QuestionsOpenView.DataContext = questionsViewModel; // this.DataContext = gameViewModel; }