예제 #1
0
 public GamePage()
 {
     this.InitializeComponent();
     _settingsViewModel = (Application.Current as App).SettingsViewModel;
     gameViewModel = new GameViewModel(_settingsViewModel);
     this.DataContext = gameViewModel;
 }
예제 #2
0
 public GameViewModel(SettingsViewModel settings)
 {
     m_uSpendTime = 0;
     m_uTimer = 0;
     m_uPrimary = 0;
     m_uSecond = 0;
     m_uAdvance = 0;
     game = new Game(settings.m_uXnum, settings.m_uYnum, settings.m_uMineNum);
 }
예제 #3
0
 /// <summary>
 /// 初始化单一实例应用程序对象。这是执行的创作代码的第一行,
 /// 逻辑上等同于 main() 或 WinMain()。
 /// </summary>
 public App()
 {
     this.InitializeComponent();
     this.Suspending += OnSuspending;
     SettingsViewModel = new SettingsViewModel();
     SettingsViewModel.m_uMineNum = 1;
     SettingsViewModel.m_uXnum = 3;
     SettingsViewModel.m_uYnum = 3;
 }
 public SimpleSettingsNarrow()
 {
     this.InitializeComponent();
     settings = (Application.Current as App).SettingsViewModel;
 }