CheatWindow.axaml 4.2 KB

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