Beispiel #1
0
        public App()
        {
            this.ReadConfig();

            this.model = new StellarCartographyModel(this.resolutionX, this.resolutionY, this.rounds, this.gameFieldRows, this.gameFieldColumns);

            this.mainViewModel       = new MainViewModel(this.model, this.roundTime);
            this.mainViewModel.Quit += OnMainWindowQuit;

            this.mainWindow             = new MainWindow();
            this.mainWindow.DataContext = this.mainViewModel;
        }
Beispiel #2
0
        public MainViewModel(StellarCartographyModel model, Int32 roundTime)
        {
            this.ROUND_TIME = roundTime;

            this.model = model;
            this.model.UpdateGameField  += OnUpdateGameField;
            this.model.UpdateStatusText += OnUpdateStatusText;

            OnPropertyChanged("ItemsControlWidth");
            OnPropertyChanged("ItemsControlHeight");

            this.ItemsControlVisible = false;
            this.StatusVisible       = true;
            this.StatusLabelContent  = "Get ready!";

            this.QuitCommand = new DelegateCommand(param => OnQuitCommand());
            this.StepCommand = new DelegateCommand(param => OnStepCommand());
            this.TestCommand = new DelegateCommand(param => OnTestCommand());
        }