MainPage.xaml 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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="22" />
  20. <Setter Property="Margin" Value="0,5,0,0" />
  21. </Style>
  22. <Style x:Key="NavText" TargetType="TextBlock">
  23. <Setter Property="FontSize" Value="22" />
  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="GameInfoHeaderPanel" TargetType="RelativePanel">
  32. <Setter Property="VerticalAlignment" Value="Center" />
  33. <Setter Property="Margin" Value="10,5,10,0" />
  34. </Style>
  35. <Style x:Key="GameInfoIcon" TargetType="TextBlock">
  36. <Setter Property="FontFamily" Value="Segoe MDL2 Assets" />
  37. <Setter Property="FontSize" Value="16" />
  38. <Setter Property="Margin" Value="5,5,0,0" />
  39. </Style>
  40. <Style x:Key="GameInfoText" TargetType="TextBlock">
  41. <Setter Property="FontSize" Value="16" />
  42. <Setter Property="Margin" Value="15,0,0,0" />
  43. </Style>
  44. </Page.Resources>
  45. <Grid>
  46. <Grid.RowDefinitions>
  47. <RowDefinition Height="Auto" />
  48. <RowDefinition Height="*" />
  49. </Grid.RowDefinitions>
  50. <RelativePanel Grid.Row="0">
  51. <Button RelativePanel.AlignLeftWithPanel="True" Name="NavButton" Click="NavButton_Click" VerticalAlignment="Stretch" FontFamily="Segoe MDL2 Assets" Content="&#xE700;" FontSize="28" />
  52. <Viewbox RelativePanel.RightOf="NavButton" RelativePanel.AlignBottomWith="NavButton" StretchDirection="DownOnly" Stretch="UniformToFill" Margin="10,0,10,0">
  53. <TextBlock FontSize="28" Name="PageTitle" Text="YJMPD-UWP" />
  54. </Viewbox>
  55. </RelativePanel>
  56. <SplitView Grid.Row="1" Name="NavView" DisplayMode="Overlay" OpenPaneLength="275">
  57. <SplitView.Pane>
  58. <RelativePanel VerticalAlignment="Stretch"
  59. ManipulationMode="TranslateX"
  60. ManipulationCompleted="Pane_ManipulationCompleted" Style="{ThemeResource DarkModeFix}">
  61. <Viewbox Stretch="Uniform" StretchDirection="DownOnly" HorizontalAlignment="Stretch" RelativePanel.AlignTopWithPanel="True">
  62. <ListBox SelectionMode="Single" Name="NavList" SelectionChanged="NavList_SelectionChanged" Tapped="NavList_Tapped">
  63. <ListBoxItem Name="NavListHome" ManipulationMode="TranslateX" ManipulationCompleted="Pane_ManipulationCompleted">
  64. <StackPanel Style="{StaticResource NavStackPanel}">
  65. <TextBlock Style="{StaticResource NavIcon}" Text="&#xE80F;"/>
  66. <TextBlock Style="{StaticResource NavText}" Text="Game"/>
  67. </StackPanel>
  68. </ListBoxItem>
  69. <ListBoxItem Name="NavListStatistics" ManipulationMode="TranslateX" ManipulationCompleted="Pane_ManipulationCompleted">
  70. <StackPanel Style="{StaticResource NavStackPanel}">
  71. <TextBlock Style="{StaticResource NavIcon}" Text="&#xE8F1;"/>
  72. <TextBlock Style="{StaticResource NavText}" Text="Statistics"/>
  73. </StackPanel>
  74. </ListBoxItem>
  75. <ListBoxItem Name="NavListAbout" ManipulationMode="TranslateX" ManipulationCompleted="Pane_ManipulationCompleted">
  76. <StackPanel Style="{StaticResource NavStackPanel}">
  77. <TextBlock Style="{StaticResource NavIcon}" Text="&#xE897;"/>
  78. <TextBlock Style="{StaticResource NavText}" Text="About"/>
  79. </StackPanel>
  80. </ListBoxItem>
  81. <ListBoxItem Name="NavListSettings" ManipulationMode="TranslateX" ManipulationCompleted="Pane_ManipulationCompleted">
  82. <StackPanel Style="{StaticResource NavStackPanel}">
  83. <TextBlock Style="{StaticResource NavIcon}" Text="&#xE713;"/>
  84. <TextBlock Style="{StaticResource NavText}" Text="Settings"/>
  85. </StackPanel>
  86. </ListBoxItem>
  87. </ListBox>
  88. </Viewbox>
  89. <RelativePanel RelativePanel.AlignBottomWithPanel="True" RelativePanel.AlignLeftWithPanel="True" RelativePanel.AlignRightWithPanel="True" Background="Gray">
  90. <StackPanel Visibility="{Binding GameVisible, Converter={StaticResource BoolToVisConverter}}" RelativePanel.AlignLeftWithPanel="True" RelativePanel.AlignRightWithPanel="True" RelativePanel.Above="Copyright" Margin="0,0,0,8">
  91. <RelativePanel Style="{StaticResource GameInfoHeaderPanel}">
  92. <TextBlock Margin="5,0,0,0" FontSize="18" FontWeight="Bold" Text="Current game" />
  93. <HyperlinkButton Click="BackToGame_Click" RelativePanel.AlignRightWithPanel="True">
  94. <StackPanel Orientation="Horizontal">
  95. <TextBlock Style="{StaticResource Icon}" Text="&#xE7A7;" Margin="0,3,0,0" Foreground="Black"/>
  96. <TextBlock Text="Back to game" Margin="5,0,0,0" Foreground="Black"/>
  97. </StackPanel>
  98. </HyperlinkButton>
  99. </RelativePanel>
  100. <StackPanel Style="{StaticResource GameInfoPanel}">
  101. <TextBlock Style="{StaticResource GameInfoIcon}" Text="&#xE8A1;"/>
  102. <TextBlock Style="{StaticResource GameInfoText}" Text="{Binding GameState}"/>
  103. </StackPanel>
  104. <StackPanel Style="{StaticResource GameInfoPanel}">
  105. <TextBlock Style="{StaticResource GameInfoIcon}" Text="&#xE716;"/>
  106. <TextBlock Style="{StaticResource GameInfoText}" Text="{Binding Players}"/>
  107. </StackPanel>
  108. </StackPanel>
  109. <StackPanel Orientation="Horizontal" Margin="15,5" RelativePanel.AlignBottomWithPanel="True" Name="Copyright">
  110. <TextBlock Text="YJMPD-UWP ©"/>
  111. <TextBlock Text="{Binding Year}" Margin="5,0,0,0" />
  112. </StackPanel>
  113. </RelativePanel>
  114. </RelativePanel>
  115. </SplitView.Pane>
  116. <SplitView.Content>
  117. <Grid>
  118. <Frame Name="Frame"/>
  119. <StackPanel ManipulationMode="TranslateX"
  120. ManipulationCompleted="Content_ManipulationCompleted"
  121. Width="10"
  122. Background="Transparent"
  123. HorizontalAlignment="Left"
  124. VerticalAlignment="Stretch">
  125. </StackPanel>
  126. <StackPanel Name="BackMessage" Background="LightGray" Opacity="0.7" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Margin="0,0,0,40" Visibility="Collapsed" Height="Auto">
  127. <TextBlock Text="Press back again to exit" Margin="5" HorizontalAlignment="Center" TextAlignment="Center"/>
  128. </StackPanel>
  129. </Grid>
  130. </SplitView.Content>
  131. </SplitView>
  132. </Grid>
  133. </Page>