コード例 #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
ファイル: App.xaml.cs プロジェクト: lantian2012/MineSweeper
 /// <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;
 }
コード例 #4
0
 public SimpleSettingsNarrow()
 {
     this.InitializeComponent();
     settings = (Application.Current as App).SettingsViewModel;
 }