CheatWindow.axaml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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="*" />
  27. <RowDefinition Height="Auto" />
  28. </Grid.RowDefinitions>
  29. <TextBlock
  30. Grid.Row="1"
  31. MaxWidth="500"
  32. Margin="20,15,20,20"
  33. HorizontalAlignment="Center"
  34. VerticalAlignment="Center"
  35. LineHeight="18"
  36. Text="{Binding Heading}"
  37. TextAlignment="Center"
  38. TextWrapping="Wrap" />
  39. <Border
  40. Grid.Row="2"
  41. Margin="5"
  42. HorizontalAlignment="Stretch"
  43. VerticalAlignment="Stretch"
  44. BorderBrush="Gray"
  45. BorderThickness="1">
  46. <TreeView
  47. Name="CheatsView"
  48. MinHeight="300"
  49. HorizontalAlignment="Stretch"
  50. VerticalAlignment="Stretch"
  51. Items="{Binding LoadedCheats}">
  52. <TreeView.Styles>
  53. <Styles>
  54. <Style Selector="TreeViewItem:empty /template/ ItemsPresenter">
  55. <Setter Property="IsVisible" Value="False" />
  56. </Style>
  57. </Styles>
  58. </TreeView.Styles>
  59. <TreeView.DataTemplates>
  60. <TreeDataTemplate DataType="model:CheatsList" ItemsSource="{Binding}">
  61. <StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
  62. <CheckBox MinWidth="20" IsChecked="{Binding IsEnabled}" />
  63. <TextBlock Width="150" Text="{Binding BuildId}" />
  64. <TextBlock Text="{Binding Path}" />
  65. </StackPanel>
  66. </TreeDataTemplate>
  67. <DataTemplate x:DataType="model:CheatModel">
  68. <StackPanel
  69. Margin="0"
  70. HorizontalAlignment="Left"
  71. Orientation="Horizontal">
  72. <CheckBox
  73. MinWidth="20"
  74. Margin="5,0"
  75. Padding="0"
  76. IsChecked="{Binding IsEnabled}" />
  77. <TextBlock VerticalAlignment="Center" Text="{Binding CleanName}" />
  78. </StackPanel>
  79. </DataTemplate>
  80. </TreeView.DataTemplates>
  81. </TreeView>
  82. </Border>
  83. <DockPanel
  84. Grid.Row="3"
  85. Margin="0"
  86. HorizontalAlignment="Stretch">
  87. <DockPanel Margin="0" HorizontalAlignment="Right">
  88. <Button
  89. Name="SaveButton"
  90. MinWidth="90"
  91. Margin="5"
  92. Command="{Binding Save}"
  93. IsVisible="{Binding !NoCheatsFound}">
  94. <TextBlock Text="{locale:Locale SettingsButtonSave}" />
  95. </Button>
  96. <Button
  97. Name="CancelButton"
  98. MinWidth="90"
  99. Margin="5"
  100. Command="{Binding Close}">
  101. <TextBlock Text="{locale:Locale InputDialogCancel}" />
  102. </Button>
  103. </DockPanel>
  104. </DockPanel>
  105. </Grid>
  106. </window:StyleableWindow>