public QuestionsViewModel(Questions questions)
 {
     if (questions == null)
     {
         throw new NullReferenceException("questions");
     }
     this.questions = questions;
 }
Beispiel #2
0
        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;
        }