MainWindow.axaml 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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="FullscreenHotKeyMacOS" Command="{ReflectionBinding ToggleFullscreen}" />
  47. <helpers:HotKeyControl Name="DockToggleHotKey" Command="{ReflectionBinding ToggleDockMode}" />
  48. <helpers:HotKeyControl Name="ExitHotKey" Command="{ReflectionBinding ExitCurrentState}" />
  49. </StackPanel>
  50. <Grid
  51. Grid.Row="1"
  52. HorizontalAlignment="Stretch"
  53. VerticalAlignment="Stretch">
  54. <Grid.ColumnDefinitions>
  55. <ColumnDefinition Width="*" />
  56. </Grid.ColumnDefinitions>
  57. <Grid.RowDefinitions>
  58. <RowDefinition Height="Auto" />
  59. <RowDefinition Height="*" />
  60. <RowDefinition Height="Auto" />
  61. </Grid.RowDefinitions>
  62. <StackPanel
  63. Name="MenuBar"
  64. MinHeight="35"
  65. Grid.Row="0"
  66. Margin="0"
  67. HorizontalAlignment="Stretch"
  68. VerticalAlignment="Stretch"
  69. IsVisible="{Binding ShowMenuAndStatusBar}"
  70. Orientation="Vertical">
  71. <main:MainMenuBarView
  72. Name="MenuBarView" />
  73. </StackPanel>
  74. <ContentControl
  75. Name="MainContent"
  76. Grid.Row="1"
  77. Padding="0"
  78. HorizontalAlignment="Stretch"
  79. VerticalAlignment="Stretch"
  80. BorderBrush="{DynamicResource ThemeControlBorderColor}"
  81. BorderThickness="0,0,0,0"
  82. DockPanel.Dock="Top"
  83. IsVisible="{Binding ShowContent}">
  84. <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Name="GameLibrary">
  85. <Grid.RowDefinitions>
  86. <RowDefinition Height="Auto" />
  87. <RowDefinition Height="*" />
  88. </Grid.RowDefinitions>
  89. <main:MainViewControls
  90. Name="ViewControls"
  91. Grid.Row="0"/>
  92. <controls:GameListView
  93. x:Name="GameList"
  94. Grid.Row="1"
  95. HorizontalAlignment="Stretch"
  96. VerticalAlignment="Stretch"
  97. HorizontalContentAlignment="Stretch"
  98. VerticalContentAlignment="Stretch"
  99. IsVisible="{Binding IsList}" />
  100. <controls:GameGridView
  101. x:Name="GameGrid"
  102. Grid.Row="1"
  103. HorizontalAlignment="Stretch"
  104. VerticalAlignment="Stretch"
  105. HorizontalContentAlignment="Stretch"
  106. VerticalContentAlignment="Stretch"
  107. IsVisible="{Binding IsGrid}" />
  108. </Grid>
  109. </ContentControl>
  110. <Grid
  111. Grid.Row="1"
  112. HorizontalAlignment="Stretch"
  113. VerticalAlignment="Stretch"
  114. Background="{DynamicResource ThemeContentBackgroundColor}"
  115. IsVisible="{Binding ShowLoadProgress}"
  116. Name="LoadingView"
  117. ZIndex="1000">
  118. <Grid
  119. Margin="40"
  120. HorizontalAlignment="Center"
  121. VerticalAlignment="Center"
  122. IsVisible="{Binding ShowLoadProgress}">
  123. <Grid.ColumnDefinitions>
  124. <ColumnDefinition Width="Auto" />
  125. <ColumnDefinition Width="*" />
  126. </Grid.ColumnDefinitions>
  127. <Border
  128. Grid.RowSpan="2"
  129. Grid.Column="0"
  130. Width="256"
  131. Height="256"
  132. Margin="10"
  133. Padding="4"
  134. BorderBrush="Black"
  135. BorderThickness="2"
  136. BoxShadow="4 4 32 8 #40000000"
  137. CornerRadius="3"
  138. IsVisible="{Binding ShowLoadProgress}">
  139. <Image
  140. Width="256"
  141. Height="256"
  142. IsVisible="{Binding ShowLoadProgress}"
  143. Source="{Binding SelectedIcon, Converter={StaticResource ByteImage}}" />
  144. </Border>
  145. <Grid
  146. Grid.Column="1"
  147. HorizontalAlignment="Stretch"
  148. VerticalAlignment="Center"
  149. IsVisible="{Binding ShowLoadProgress}">
  150. <Grid.RowDefinitions>
  151. <RowDefinition Height="Auto" />
  152. <RowDefinition Height="Auto" />
  153. <RowDefinition Height="Auto" />
  154. </Grid.RowDefinitions>
  155. <TextBlock
  156. Grid.Row="0"
  157. Margin="10"
  158. FontSize="30"
  159. FontWeight="Bold"
  160. IsVisible="{Binding ShowLoadProgress}"
  161. Text="{Binding LoadHeading}"
  162. TextAlignment="Left"
  163. TextWrapping="Wrap"
  164. MaxWidth="500" />
  165. <Border
  166. Grid.Row="1"
  167. Margin="10"
  168. Padding="0"
  169. HorizontalAlignment="Stretch"
  170. BorderBrush="{Binding ProgressBarBackgroundColor}"
  171. BorderThickness="1"
  172. ClipToBounds="True"
  173. CornerRadius="5"
  174. IsVisible="{Binding ShowLoadProgress}">
  175. <ProgressBar
  176. Height="10"
  177. MinWidth="500"
  178. Margin="0"
  179. Padding="0"
  180. HorizontalAlignment="Stretch"
  181. ClipToBounds="True"
  182. CornerRadius="5"
  183. Foreground="{Binding ProgressBarForegroundColor}"
  184. IsIndeterminate="{Binding IsLoadingIndeterminate}"
  185. IsVisible="{Binding ShowLoadProgress}"
  186. Maximum="{Binding ProgressMaximum}"
  187. Minimum="0"
  188. Value="{Binding ProgressValue}" />
  189. </Border>
  190. <TextBlock
  191. Grid.Row="2"
  192. Margin="10"
  193. FontSize="18"
  194. IsVisible="{Binding ShowLoadProgress}"
  195. Text="{Binding CacheLoadStatus}"
  196. TextAlignment="Left"
  197. MaxWidth="500" />
  198. </Grid>
  199. </Grid>
  200. </Grid>
  201. <main:MainStatusBarView
  202. Name="StatusBarView"
  203. Grid.Row="2" />
  204. </Grid>
  205. </Grid>
  206. </window:StyleableWindow>