MainPage.xaml 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <Page
  2. x:Class="YJMPD_UWP.MainPage"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:local="using:YJMPD_UWP"
  6. xmlns:convert="using:YJMPD_UWP.Helpers.Converter"
  7. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. mc:Ignorable="d">
  10. <Page.Resources>
  11. <convert:BoolToVisibilityConverter x:Key="BoolToVisConverter" />
  12. <Style x:Key="NavStackPanel" TargetType="StackPanel">
  13. <Setter Property="Orientation" Value="Horizontal" />
  14. <Setter Property="VerticalAlignment" Value="Center" />
  15. <Setter Property="MinWidth" Value="275" />
  16. </Style>
  17. <Style x:Key="NavIcon" TargetType="TextBlock">
  18. <Setter Property="FontFamily" Value="Segoe MDL2 Assets" />
  19. <Setter Property="FontSize" Value="28" />
  20. <Setter Property="Margin" Value="0,5,0,0" />
  21. </Style>
  22. <Style x:Key="NavText" TargetType="TextBlock">
  23. <Setter Property="FontSize" Value="28" />
  24. <Setter Property="Margin" Value="18,0,0,0" />
  25. </Style>
  26. <Style x:Key="GameInfoPanel" TargetType="StackPanel">
  27. <Setter Property="Orientation" Value="Horizontal" />
  28. <Setter Property="VerticalAlignment" Value="Center" />
  29. <Setter Property="Margin" Value="10,5,10,0" />
  30. </Style>
  31. <Style x:Key="GameInfoIcon" TargetType="TextBlock">
  32. <Setter Property="FontFamily" Value="Segoe MDL2 Assets" />
  33. <Setter Property="FontSize" Value="20" />
  34. <Setter Property="Margin" Value="5,5,0,0" />
  35. </Style>
  36. <Style x:Key="GameInfoText" TargetType="TextBlock">
  37. <Setter Property="FontSize" Value="20" />
  38. <Setter Property="Margin" Value="15,0,0,0" />
  39. </Style>
  40. </Page.Resources>
  41. <Grid>
  42. <Grid.RowDefinitions>
  43. <RowDefinition Height="Auto" />
  44. <RowDefinition Height="*" />
  45. </Grid.RowDefinitions>
  46. <RelativePanel Grid.Row="0">
  47. <Button RelativePanel.AlignLeftWithPanel="True" Name="NavButton" Click="NavButton_Click" VerticalAlignment="Stretch" FontFamily="Segoe MDL2 Assets" Content="&#xE700;" FontSize="28" />
  48. <Viewbox RelativePanel.RightOf="NavButton" RelativePanel.AlignBottomWith="NavButton" StretchDirection="DownOnly" Stretch="UniformToFill" Margin="10,0,10,0">
  49. <TextBlock FontSize="28" Name="PageTitle" Text="YJMPD-UWP" />
  50. </Viewbox>
  51. </RelativePanel>
  52. <SplitView Grid.Row="1" Name="NavView" DisplayMode="Overlay" OpenPaneLength="275">
  53. <SplitView.Pane>
  54. <RelativePanel VerticalAlignment="Stretch"
  55. ManipulationMode="TranslateX"
  56. ManipulationCompleted="Pane_ManipulationCompleted" Style="{ThemeResource DarkModeFix}">
  57. <Viewbox Stretch="Uniform" StretchDirection="DownOnly" HorizontalAlignment="Stretch" RelativePanel.AlignTopWithPanel="True">
  58. <ListBox SelectionMode="Single" Name="NavList" SelectionChanged="NavList_SelectionChanged" Tapped="NavList_Tapped">
  59. <ListBoxItem Name="NavListHome" ManipulationMode="TranslateX" ManipulationCompleted="Pane_ManipulationCompleted">
  60. <StackPanel Style="{StaticResource NavStackPanel}">
  61. <TextBlock Style="{StaticResource NavIcon}" Text="&#xE80F;"/>
  62. <TextBlock Style="{StaticResource NavText}" Text="Game"/>
  63. </StackPanel>
  64. </ListBoxItem>
  65. <ListBoxItem Name="NavListStatistics" ManipulationMode="TranslateX" ManipulationCompleted="Pane_ManipulationCompleted">
  66. <StackPanel Style="{StaticResource NavStackPanel}">
  67. <TextBlock Style="{StaticResource NavIcon}" Text="&#xE8F1;"/>
  68. <TextBlock Style="{StaticResource NavText}" Text="Statistics"/>
  69. </StackPanel>
  70. </ListBoxItem>
  71. <ListBoxItem Name="NavListAbout" ManipulationMode="TranslateX" ManipulationCompleted="Pane_ManipulationCompleted">
  72. <StackPanel Style="{StaticResource NavStackPanel}">
  73. <TextBlock Style="{StaticResource NavIcon}" Text="&#xE897;"/>
  74. <TextBlock Style="{StaticResource NavText}" Text="About"/>
  75. </StackPanel>
  76. </ListBoxItem>
  77. <ListBoxItem Name="NavListSettings" ManipulationMode="TranslateX" ManipulationCompleted="Pane_ManipulationCompleted">
  78. <StackPanel Style="{StaticResource NavStackPanel}">
  79. <TextBlock Style="{StaticResource NavIcon}" Text="&#xE713;"/>
  80. <TextBlock Style="{StaticResource NavText}" Text="Settings"/>
  81. </StackPanel>
  82. </ListBoxItem>
  83. </ListBox>
  84. </Viewbox>
  85. <StackPanel RelativePanel.AlignBottomWithPanel="True" RelativePanel.AlignLeftWithPanel="True" RelativePanel.AlignRightWithPanel="True" Background="Gray">
  86. <StackPanel Visibility="{Binding GameVisible, Converter={StaticResource BoolToVisConverter}}" HorizontalAlignment="Stretch">
  87. <StackPanel Style="{StaticResource GameInfoPanel}">
  88. <TextBlock Margin="5,0,0,0" FontSize="16" FontWeight="Bold" Text="Current game"/>
  89. </StackPanel>
  90. <StackPanel Style="{StaticResource GameInfoPanel}">
  91. <TextBlock Style="{StaticResource GameInfoIcon}" Text="&#xE8A1;"/>
  92. <TextBlock Style="{StaticResource GameInfoText}" Text="{Binding GameState}"/>
  93. </StackPanel>
  94. <StackPanel Style="{StaticResource GameInfoPanel}">
  95. <TextBlock Style="{StaticResource GameInfoIcon}" Text="&#xE716;"/>
  96. <TextBlock Style="{StaticResource GameInfoText}" Text="{Binding Players}"/>
  97. </StackPanel>
  98. <StackPanel Style="{StaticResource GameInfoPanel}">
  99. <Button Content="Back to Game" Click="BackToGame_Click" Style="{StaticResource Green}"/>
  100. </StackPanel>
  101. </StackPanel>
  102. <StackPanel Orientation="Horizontal" Margin="15,5">
  103. <TextBlock Text="YJMPD-UWP @"/>
  104. <TextBlock Text="{Binding Year}" Margin="5,0,0,0" />
  105. </StackPanel>
  106. </StackPanel>
  107. </RelativePanel>
  108. </SplitView.Pane>
  109. <SplitView.Content>
  110. <Grid>
  111. <Frame Name="Frame"/>
  112. <StackPanel ManipulationMode="TranslateX"
  113. ManipulationCompleted="Content_ManipulationCompleted"
  114. Width="10"
  115. Background="Transparent"
  116. HorizontalAlignment="Left"
  117. VerticalAlignment="Stretch">
  118. </StackPanel>
  119. <StackPanel Name="BackMessage" Background="LightGray" Opacity="0.7" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Margin="0,0,0,40" Visibility="Collapsed" Height="Auto">
  120. <TextBlock Text="Press back again to exit" Margin="5" HorizontalAlignment="Center" TextAlignment="Center"/>
  121. </StackPanel>
  122. </Grid>
  123. </SplitView.Content>
  124. </SplitView>
  125. </Grid>
  126. </Page>