コード例 #1
0
ファイル: GamePage.xaml.cs プロジェクト: Arcidev/Card-Game
 private void OnPacketProcessed(UInt16 packet)
 {
     if (packet == (UInt16)SMSGPackets.AvailableCards)
     {
         Application.Current.Dispatcher.Invoke(() =>
         {
             GameFrame.Navigate(new SelectCards());
         });
     }
     else if (packet == (UInt16)SMSGPackets.SelectCards)
     {
         Application.Current.Dispatcher.Invoke(() =>
         {
             GameFrame.Navigate(new PlayingGame());
         });
     }
     else if (packet == (UInt16)SMSGPackets.Achievements)
     {
         Application.Current.Dispatcher.Invoke(() =>
         {
             GameFrame.Navigate(new AchievementsPage());
         });
     }
 }
コード例 #2
0
 public void RestartGame()
 {
     game = new Game();
     GameFrame.Navigate(typeof(Game), null, new DrillInNavigationTransitionInfo());
 }
コード例 #3
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public MainWindow()
 {
     InitializeComponent();
     GameFrame.NavigationUIVisibility = System.Windows.Navigation.NavigationUIVisibility.Hidden;
     GameFrame.Navigate(new MainMenu());
 }