Explorar el Código

Added all pages

Kenneth van Ewijk hace 10 años
padre
commit
77f6217228

+ 7 - 6
YJMPD-UWP/MainPage.xaml.cs

@@ -121,7 +121,11 @@ namespace YJMPD_UWP
             NavView.IsPaneOpen = false;
 
             if (NavListHome.IsSelected)
+            {
+                if (Frame.BackStack.Count >= 1)
+                    Frame.BackStack.Clear();
                 Frame.Navigate(typeof(MatchView));
+            }
             else
             if (NavListStatistics.IsSelected)
                 Frame.Navigate(typeof(StatisticsView));
@@ -138,13 +142,10 @@ namespace YJMPD_UWP
             NavView.IsPaneOpen = false;
         }
 
-        private async void BackToGame_Click(object sender, RoutedEventArgs e)
+        private void BackToGame_Click(object sender, RoutedEventArgs e)
         {
-            bool b = await Util.ShowConfirmDialog("View Scores", "Go to the scores page (test)?", Util.DialogType.OKCANCEL);
-            if(b)
-            {
-                App.Navigate(typeof(ScoreView));
-            }
+            NavView.IsPaneOpen = false;
+            App.Game.BackToGame();
         }
 
         private void Content_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)

+ 24 - 0
YJMPD-UWP/Model/GameHandler.cs

@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.Threading.Tasks;
 using YJMPD_UWP.Helpers.EventArgs;
 using YJMPD_UWP.Model.Object;
+using YJMPD_UWP.Views;
 
 namespace YJMPD_UWP.Model
 {
@@ -124,5 +125,28 @@ namespace YJMPD_UWP.Model
             UpdateGameStatus(GameStatus.STOPPED);
             return true;
         }
+
+
+        public void BackToGame()
+        {
+            switch(Status)
+            {
+                default:
+                case GameStatus.STOPPED:
+                    break;
+                case GameStatus.SEARCHING:
+                    App.Navigate(typeof(MatchView));
+                    break;
+                case GameStatus.WAITING:
+                    App.Navigate(typeof(WaitingView));
+                    break;
+                case GameStatus.STARTED:
+                    App.Navigate(typeof(GameView));
+                    break;
+                case GameStatus.ENDED:
+                    App.Navigate(typeof(ScoreView));
+                    break;
+            }
+        }
     }
 }

+ 16 - 0
YJMPD-UWP/ViewModels/GameVM.cs

@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace YJMPD_UWP.ViewModels
+{
+    public class GameVM : TemplateVM
+    {
+        public GameVM() : base("Game")
+        {
+
+        }
+    }
+}

+ 16 - 0
YJMPD-UWP/ViewModels/PhotoVM.cs

@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace YJMPD_UWP.ViewModels
+{
+    public class PhotoVM : TemplateVM
+    {
+        public PhotoVM() : base("Photo")
+        {
+
+        }
+    }
+}

+ 15 - 0
YJMPD-UWP/Views/GameView.xaml

@@ -0,0 +1,15 @@
+<Page
+    x:Class="YJMPD_UWP.Views.GameView"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:local="using:YJMPD_UWP.Views"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    mc:Ignorable="d">
+
+    <ScrollViewer>
+        <StackPanel Style="{StaticResource BaseStackPanel}">
+
+        </StackPanel>
+    </ScrollViewer>
+</Page>

+ 30 - 0
YJMPD-UWP/Views/GameView.xaml.cs

@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices.WindowsRuntime;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Controls.Primitives;
+using Windows.UI.Xaml.Data;
+using Windows.UI.Xaml.Input;
+using Windows.UI.Xaml.Media;
+using Windows.UI.Xaml.Navigation;
+using YJMPD_UWP.ViewModels;
+
+namespace YJMPD_UWP.Views
+{
+    public sealed partial class GameView : Page
+    {
+        GameVM gamevm;
+
+        public GameView()
+        {
+            gamevm = new GameVM();
+            this.DataContext = gamevm;
+            this.InitializeComponent();
+        }
+    }
+}

+ 15 - 0
YJMPD-UWP/Views/PhotoView.xaml

@@ -0,0 +1,15 @@
+<Page
+    x:Class="YJMPD_UWP.Views.PhotoView"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:local="using:YJMPD_UWP.Views"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    mc:Ignorable="d">
+
+    <ScrollViewer>
+        <StackPanel Style="{StaticResource BaseStackPanel}">
+            
+        </StackPanel>
+    </ScrollViewer>
+</Page>

+ 30 - 0
YJMPD-UWP/Views/PhotoView.xaml.cs

@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices.WindowsRuntime;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Controls.Primitives;
+using Windows.UI.Xaml.Data;
+using Windows.UI.Xaml.Input;
+using Windows.UI.Xaml.Media;
+using Windows.UI.Xaml.Navigation;
+using YJMPD_UWP.ViewModels;
+
+namespace YJMPD_UWP.Views
+{
+    public sealed partial class PhotoView : Page
+    {
+        PhotoVM photovm;
+
+        public PhotoView()
+        {
+            photovm = new PhotoVM();
+            this.DataContext = photovm;
+            this.InitializeComponent();
+        }
+    }
+}

+ 10 - 0
YJMPD-UWP/Views/ScoreView.xaml.cs

@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.IO;
 using System.Linq;
 using System.Runtime.InteropServices.WindowsRuntime;
+using System.Threading.Tasks;
 using Windows.Foundation;
 using Windows.Foundation.Collections;
 using Windows.UI.Xaml;
@@ -28,9 +29,18 @@ namespace YJMPD_UWP.Views
         }
 
         private void ReadyButton_Click(object sender, RoutedEventArgs e)
+        {
+            Ready();
+        }
+
+        private async void Ready()
         {
             ReadyCheck.Visibility = Visibility.Visible;
             ReadyButton.IsEnabled = false;
+
+            Task.Delay(TimeSpan.FromMilliseconds(1500));
+
+            App.Navigate(typeof(WaitingView));
         }
     }
 }

+ 16 - 0
YJMPD-UWP/Views/WaitingView.xaml

@@ -0,0 +1,16 @@
+<Page
+    x:Class="YJMPD_UWP.Views.WaitingView"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:local="using:YJMPD_UWP.Views"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    mc:Ignorable="d">
+
+    <RelativePanel Style="{StaticResource BaseRelativePanel}">
+        <StackPanel RelativePanel.AlignHorizontalCenterWithPanel="True" RelativePanel.AlignVerticalCenterWithPanel="True" Margin="0,-50,0,0">
+            <ProgressRing Width="80" Height="80" HorizontalAlignment="Center" IsActive="True" />
+            <TextBlock Text="Waiting on other players..." FontSize="20" Margin="0,20,0,0"/>
+        </StackPanel>
+    </RelativePanel>
+</Page>

+ 30 - 0
YJMPD-UWP/Views/WaitingView.xaml.cs

@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices.WindowsRuntime;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Controls.Primitives;
+using Windows.UI.Xaml.Data;
+using Windows.UI.Xaml.Input;
+using Windows.UI.Xaml.Media;
+using Windows.UI.Xaml.Navigation;
+
+// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
+
+namespace YJMPD_UWP.Views
+{
+    /// <summary>
+    /// An empty page that can be used on its own or navigated to within a Frame.
+    /// </summary>
+    public sealed partial class WaitingView : Page
+    {
+        public WaitingView()
+        {
+            this.InitializeComponent();
+        }
+    }
+}

+ 23 - 0
YJMPD-UWP/YJMPD-UWP.csproj

@@ -117,8 +117,10 @@
     <Compile Include="Model\PhotoHandler.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="ViewModels\AboutVM.cs" />
+    <Compile Include="ViewModels\GameVM.cs" />
     <Compile Include="ViewModels\MainPageVM.cs" />
     <Compile Include="ViewModels\MatchVM.cs" />
+    <Compile Include="ViewModels\PhotoVM.cs" />
     <Compile Include="ViewModels\ScoreVM.cs" />
     <Compile Include="ViewModels\SettingsVM.cs" />
     <Compile Include="ViewModels\StatisticsVM.cs" />
@@ -126,9 +128,15 @@
     <Compile Include="Views\AboutView.xaml.cs">
       <DependentUpon>AboutView.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\GameView.xaml.cs">
+      <DependentUpon>GameView.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\MatchView.xaml.cs">
       <DependentUpon>MatchView.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\PhotoView.xaml.cs">
+      <DependentUpon>PhotoView.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\ScoreView.xaml.cs">
       <DependentUpon>ScoreView.xaml</DependentUpon>
     </Compile>
@@ -138,6 +146,9 @@
     <Compile Include="Views\StatisticsView.xaml.cs">
       <DependentUpon>StatisticsView.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\WaitingView.xaml.cs">
+      <DependentUpon>WaitingView.xaml</DependentUpon>
+    </Compile>
   </ItemGroup>
   <ItemGroup>
     <AppxManifest Include="Package.appxmanifest">
@@ -183,10 +194,18 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </Page>
+    <Page Include="Views\GameView.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\MatchView.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\PhotoView.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\ScoreView.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -199,6 +218,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\WaitingView.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
   </ItemGroup>
   <ItemGroup>
     <Folder Include="Helpers\Comparer\" />