CheatWindow.axaml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <window:StyleableWindow
  2. x:Class="Ryujinx.Ava.UI.Windows.CheatWindow"
  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:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. xmlns:model="clr-namespace:Ryujinx.Ava.UI.Models"
  9. xmlns:window="clr-namespace:Ryujinx.Ava.UI.Windows"
  10. Width="500"
  11. Height="500"
  12. MinWidth="500"
  13. MinHeight="500"
  14. WindowStartupLocation="CenterOwner"
  15. mc:Ignorable="d"
  16. Focusable="True">
  17. <Window.Styles>
  18. <Style Selector="TreeViewItem">
  19. <Setter Property="IsExpanded" Value="True" />
  20. </Style>
  21. </Window.Styles>
  22. <Grid Name="CheatGrid" Margin="15">
  23. <Grid.RowDefinitions>
  24. <RowDefinition Height="Auto" />
  25. <RowDefinition Height="Auto" />
  26. <RowDefinition Height="Auto" />
  27. <RowDefinition Height="*" />
  28. <RowDefinition Height="Auto" />
  29. </Grid.RowDefinitions>
  30. <Grid.ColumnDefinitions>
  31. <ColumnDefinition Width="*" />
  32. <ColumnDefinition Width="*" />
  33. </Grid.ColumnDefinitions>
  34. <TextBlock
  35. Grid.Row="1"
  36. Grid.Column="0"
  37. Grid.ColumnSpan="2"
  38. MaxWidth="500"
  39. Margin="20,15,20,5"
  40. HorizontalAlignment="Center"
  41. VerticalAlignment="Center"
  42. LineHeight="18"
  43. Text="{ReflectionBinding Heading}"
  44. TextAlignment="Center"
  45. TextWrapping="Wrap" />
  46. <TextBlock
  47. Grid.Row="2"
  48. Grid.Column="0"
  49. MaxWidth="500"
  50. Margin="140,15,20,5"
  51. HorizontalAlignment="Center"
  52. VerticalAlignment="Center"
  53. LineHeight="30"
  54. Text="{locale:Locale BuildId}"
  55. TextAlignment="Center"
  56. TextWrapping="Wrap" />
  57. <TextBox
  58. Grid.Row="2"
  59. Grid.Column="1"
  60. Margin="0,5,110,5"
  61. MinWidth="160"
  62. HorizontalAlignment="Center"
  63. VerticalAlignment="Center"
  64. Text="{ReflectionBinding BuildId}"
  65. IsReadOnly="True" />
  66. <Border
  67. Grid.Row="3"
  68. Grid.Column="0"
  69. Grid.ColumnSpan="2"
  70. Margin="5"
  71. HorizontalAlignment="Stretch"
  72. VerticalAlignment="Stretch"
  73. BorderBrush="Gray"
  74. BorderThickness="1">
  75. <TreeView
  76. Name="CheatsView"
  77. MinHeight="300"
  78. HorizontalAlignment="Stretch"
  79. VerticalAlignment="Stretch"
  80. ItemsSource="{ReflectionBinding LoadedCheats}">
  81. <TreeView.Styles>
  82. <Styles>
  83. <Style Selector="TreeViewItem:empty /template/ ItemsPresenter">
  84. <Setter Property="IsVisible" Value="False" />
  85. </Style>
  86. </Styles>
  87. </TreeView.Styles>
  88. <TreeView.DataTemplates>
  89. <TreeDataTemplate DataType="model:CheatsList" ItemsSource="{Binding}">
  90. <StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
  91. <CheckBox MinWidth="20" IsChecked="{Binding IsEnabled}" />
  92. <TextBlock Width="150" Text="{Binding BuildId}" />
  93. <TextBlock Text="{Binding Path}" />
  94. </StackPanel>
  95. </TreeDataTemplate>
  96. <DataTemplate x:DataType="model:CheatModel">
  97. <StackPanel
  98. Margin="0"
  99. HorizontalAlignment="Left"
  100. Orientation="Horizontal">
  101. <CheckBox
  102. MinWidth="20"
  103. Margin="5,0"
  104. Padding="0"
  105. IsChecked="{Binding IsEnabled}" />
  106. <TextBlock VerticalAlignment="Center" Text="{Binding CleanName}" />
  107. </StackPanel>
  108. </DataTemplate>
  109. </TreeView.DataTemplates>
  110. </TreeView>
  111. </Border>
  112. <DockPanel
  113. Grid.Row="4"
  114. Grid.Column="0"
  115. Grid.ColumnSpan="2"
  116. Margin="0"
  117. HorizontalAlignment="Stretch">
  118. <DockPanel Margin="0" HorizontalAlignment="Right">
  119. <Button
  120. Name="SaveButton"
  121. MinWidth="90"
  122. Margin="5"
  123. Command="{ReflectionBinding Save}"
  124. IsVisible="{ReflectionBinding !NoCheatsFound}">
  125. <TextBlock Text="{locale:Locale SettingsButtonSave}" />
  126. </Button>
  127. <Button
  128. Name="CancelButton"
  129. MinWidth="90"
  130. Margin="5"
  131. Command="{ReflectionBinding Close}">
  132. <TextBlock Text="{locale:Locale InputDialogCancel}" />
  133. </Button>
  134. </DockPanel>
  135. </DockPanel>
  136. </Grid>
  137. </window:StyleableWindow>