MainWindow.axaml 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <window:StyleableWindow
  2. x:Class="Ryujinx.Ava.UI.Windows.MainWindow"
  3. xmlns="https://github.com/avaloniaui"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  7. xmlns:window="clr-namespace:Ryujinx.Ava.UI.Windows"
  8. xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
  9. xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
  10. xmlns:controls="clr-namespace:Ryujinx.Ava.UI.Controls"
  11. xmlns:main="clr-namespace:Ryujinx.Ava.UI.Views.Main"
  12. Cursor="{Binding Cursor}"
  13. Title="{Binding Title}"
  14. WindowState="{Binding WindowState}"
  15. Width="1280"
  16. Height="777"
  17. MinWidth="1092"
  18. MinHeight="672"
  19. d:DesignHeight="720"
  20. d:DesignWidth="1280"
  21. x:CompileBindings="True"
  22. x:DataType="viewModels:MainWindowViewModel"
  23. WindowStartupLocation="CenterScreen"
  24. mc:Ignorable="d"
  25. Focusable="True">
  26. <Window.Styles>
  27. <Style Selector="TitleBar:fullscreen">
  28. <Setter Property="Background" Value="#000000" />
  29. </Style>
  30. </Window.Styles>
  31. <Design.DataContext>
  32. <viewModels:MainWindowViewModel />
  33. </Design.DataContext>
  34. <Window.Resources>
  35. <helpers:BitmapArrayValueConverter x:Key="ByteImage" />
  36. </Window.Resources>
  37. <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
  38. <Grid.RowDefinitions>
  39. <RowDefinition Height="Auto" />
  40. <RowDefinition Height="*" />
  41. </Grid.RowDefinitions>
  42. <helpers:OffscreenTextBox Name="HiddenTextBox" Grid.Row="0" />
  43. <StackPanel Grid.Row="0" IsVisible="False">
  44. <helpers:HotKeyControl Name="FullscreenHotKey" Command="{ReflectionBinding ToggleFullscreen}" />
  45. <helpers:HotKeyControl Name="FullscreenHotKey2" Command="{ReflectionBinding ToggleFullscreen}" />
  46. <helpers:HotKeyControl Name="DockToggleHotKey" Command="{ReflectionBinding ToggleDockMode}" />
  47. <helpers:HotKeyControl Name="ExitHotKey" Command="{ReflectionBinding ExitCurrentState}" />
  48. </StackPanel>
  49. <Grid
  50. Grid.Row="1"
  51. HorizontalAlignment="Stretch"
  52. VerticalAlignment="Stretch">
  53. <Grid.ColumnDefinitions>
  54. <ColumnDefinition Width="*" />
  55. </Grid.ColumnDefinitions>
  56. <Grid.RowDefinitions>
  57. <RowDefinition Height="Auto" />
  58. <RowDefinition Height="*" />
  59. <RowDefinition Height="Auto" />
  60. </Grid.RowDefinitions>
  61. <StackPanel
  62. Name="MenuBar"
  63. MinHeight="35"
  64. Grid.Row="0"
  65. Margin="0"
  66. HorizontalAlignment="Stretch"
  67. VerticalAlignment="Stretch"
  68. IsVisible="{Binding ShowMenuAndStatusBar}"
  69. Orientation="Vertical">
  70. <main:MainMenuBarView
  71. Name="MenuBarView" />
  72. </StackPanel>
  73. <ContentControl
  74. Name="MainContent"
  75. Grid.Row="1"
  76. Padding="0"
  77. HorizontalAlignment="Stretch"
  78. VerticalAlignment="Stretch"
  79. BorderBrush="{DynamicResource ThemeControlBorderColor}"
  80. BorderThickness="0,0,0,0"
  81. DockPanel.Dock="Top"
  82. IsVisible="{Binding ShowContent}">
  83. <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Name="GameLibrary">
  84. <Grid.RowDefinitions>
  85. <RowDefinition Height="Auto" />
  86. <RowDefinition Height="*" />
  87. </Grid.RowDefinitions>
  88. <main:MainViewControls
  89. Name="ViewControls"
  90. Grid.Row="0"/>
  91. <controls:GameListView
  92. x:Name="GameList"
  93. Grid.Row="1"
  94. HorizontalAlignment="Stretch"
  95. VerticalAlignment="Stretch"
  96. HorizontalContentAlignment="Stretch"
  97. VerticalContentAlignment="Stretch"
  98. IsVisible="{Binding IsList}" />
  99. <controls:GameGridView
  100. x:Name="GameGrid"
  101. Grid.Row="1"
  102. HorizontalAlignment="Stretch"
  103. VerticalAlignment="Stretch"
  104. HorizontalContentAlignment="Stretch"
  105. VerticalContentAlignment="Stretch"
  106. IsVisible="{Binding IsGrid}" />
  107. </Grid>
  108. </ContentControl>
  109. <Grid
  110. Grid.Row="1"
  111. HorizontalAlignment="Stretch"
  112. VerticalAlignment="Stretch"
  113. Background="{DynamicResource ThemeContentBackgroundColor}"
  114. IsVisible="{Binding ShowLoadProgress}"
  115. Name="LoadingView"
  116. ZIndex="1000">
  117. <Grid
  118. Margin="40"
  119. HorizontalAlignment="Center"
  120. VerticalAlignment="Center"
  121. IsVisible="{Binding ShowLoadProgress}">
  122. <Grid.ColumnDefinitions>
  123. <ColumnDefinition Width="Auto" />
  124. <ColumnDefinition Width="*" />
  125. </Grid.ColumnDefinitions>
  126. <Border
  127. Grid.RowSpan="2"
  128. Grid.Column="0"
  129. Width="256"
  130. Height="256"
  131. Margin="10"
  132. Padding="4"
  133. BorderBrush="Black"
  134. BorderThickness="2"
  135. BoxShadow="4 4 32 8 #40000000"
  136. CornerRadius="3"
  137. IsVisible="{Binding ShowLoadProgress}">
  138. <Image
  139. Width="256"
  140. Height="256"
  141. IsVisible="{Binding ShowLoadProgress}"
  142. Source="{Binding SelectedIcon, Converter={StaticResource ByteImage}}" />
  143. </Border>
  144. <Grid
  145. Grid.Column="1"
  146. HorizontalAlignment="Stretch"
  147. VerticalAlignment="Center"
  148. IsVisible="{Binding ShowLoadProgress}">
  149. <Grid.RowDefinitions>
  150. <RowDefinition Height="Auto" />
  151. <RowDefinition Height="Auto" />
  152. <RowDefinition Height="Auto" />
  153. </Grid.RowDefinitions>
  154. <TextBlock
  155. Grid.Row="0"
  156. Margin="10"
  157. FontSize="30"
  158. FontWeight="Bold"
  159. IsVisible="{Binding ShowLoadProgress}"
  160. Text="{Binding LoadHeading}"
  161. TextAlignment="Left"
  162. TextWrapping="Wrap"
  163. MaxWidth="500" />
  164. <Border
  165. Grid.Row="1"
  166. Margin="10"
  167. Padding="0"
  168. HorizontalAlignment="Stretch"
  169. BorderBrush="{Binding ProgressBarBackgroundColor}"
  170. BorderThickness="1"
  171. ClipToBounds="True"
  172. CornerRadius="5"
  173. IsVisible="{Binding ShowLoadProgress}">
  174. <ProgressBar
  175. Height="10"
  176. MinWidth="500"
  177. Margin="0"
  178. Padding="0"
  179. HorizontalAlignment="Stretch"
  180. ClipToBounds="True"
  181. CornerRadius="5"
  182. Foreground="{Binding ProgressBarForegroundColor}"
  183. IsIndeterminate="{Binding IsLoadingIndeterminate}"
  184. IsVisible="{Binding ShowLoadProgress}"
  185. Maximum="{Binding ProgressMaximum}"
  186. Minimum="0"
  187. Value="{Binding ProgressValue}" />
  188. </Border>
  189. <TextBlock
  190. Grid.Row="2"
  191. Margin="10"
  192. FontSize="18"
  193. IsVisible="{Binding ShowLoadProgress}"
  194. Text="{Binding CacheLoadStatus}"
  195. TextAlignment="Left"
  196. MaxWidth="500" />
  197. </Grid>
  198. </Grid>
  199. </Grid>
  200. <main:MainStatusBarView
  201. Name="StatusBarView"
  202. Grid.Row="2" />
  203. </Grid>
  204. </Grid>
  205. </window:StyleableWindow>