TestMatchTheElement.axaml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
  6. x:Class="EntranseTesting.TestMatchTheElement"
  7. x:DataType="vm:MainWindowViewModel"
  8. xmlns:vm="using:EntranseTesting.ViewModels">
  9. <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
  10. <StackPanel Margin="20 0" Spacing="15" Background="Transparent">
  11. <!-- Задание -->
  12. <TextBlock Text="{Binding TestMain.TestPages.TestME.Question}"
  13. VerticalAlignment="Top"
  14. HorizontalAlignment="Stretch"
  15. TextWrapping="Wrap"/>
  16. <!-- Картинки -->
  17. <ItemsRepeater ItemsSource="{Binding TestMain.TestPages.TestME.QImage}"
  18. HorizontalAlignment="Stretch"
  19. VerticalAlignment="Stretch">
  20. <ItemsRepeater.Layout>
  21. <WrapLayout HorizontalSpacing="15" VerticalSpacing="5" Orientation="Horizontal"/>
  22. </ItemsRepeater.Layout>
  23. <ItemsRepeater.ItemTemplate>
  24. <DataTemplate>
  25. <Image Source="{Binding qImage}" Classes="Test"/>
  26. </DataTemplate>
  27. </ItemsRepeater.ItemTemplate>
  28. </ItemsRepeater>
  29. <!-- Контейнер с элементами для соотношения -->
  30. <Grid Name="MainContainer"
  31. ColumnDefinitions="Auto,*,Auto"
  32. HorizontalAlignment="Stretch">
  33. <!--// Элементы 1 группы //-->
  34. <StackPanel Orientation="Vertical" Grid.Column="0">
  35. <TextBlock Text="{Binding TestMain.TestPages.TestME.NameGroup1}"
  36. TextAlignment="Center"
  37. VerticalAlignment="Top"
  38. HorizontalAlignment="Center"
  39. TextWrapping="Wrap"/>
  40. <ItemsRepeater ItemsSource="{Binding TestMain.TestPages.TestME.ElementMatchGroup1}" Margin="15"
  41. VerticalAlignment="Center"
  42. HorizontalAlignment="Left">
  43. <ItemsRepeater.Layout>
  44. <StackLayout Spacing="10" Orientation="Vertical"/>
  45. </ItemsRepeater.Layout>
  46. <ItemsRepeater.ItemTemplate>
  47. <DataTemplate>
  48. <StackPanel Spacing="10" Orientation="Horizontal"
  49. HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
  50. <Border Padding="10 5"
  51. Background="#cfd7ff" CornerRadius="5"
  52. Cursor="Hand" PointerPressed="OnPointerPressed"
  53. Classes="CAFS">
  54. <TextBlock Text="{Binding Name}"
  55. TextAlignment="Center"
  56. VerticalAlignment="Center"
  57. TextWrapping="Wrap"/>
  58. </Border>
  59. <Border Background="#cfd7ff"
  60. IsVisible="{Binding IsActive}"
  61. CornerRadius="5"
  62. Padding="10 5"
  63. Width="50">
  64. <TextBlock Text="{Binding NumGroup}"
  65. TextAlignment="Center"
  66. HorizontalAlignment="Stretch"
  67. VerticalAlignment="Center"/>
  68. </Border>
  69. </StackPanel>
  70. </DataTemplate>
  71. </ItemsRepeater.ItemTemplate>
  72. </ItemsRepeater>
  73. </StackPanel>
  74. <!--// Элементы 2 группы//-->
  75. <StackPanel Orientation="Vertical" Grid.Column="2">
  76. <TextBlock Text="{Binding TestMain.TestPages.TestME.NameGroup1}"
  77. TextAlignment="Center"
  78. VerticalAlignment="Top"
  79. HorizontalAlignment="Center"
  80. TextWrapping="Wrap"/>
  81. <ItemsRepeater ItemsSource="{Binding TestMain.TestPages.TestME.ElementMatchGroup2}" Margin="15"
  82. VerticalAlignment="Center"
  83. HorizontalAlignment="Right">
  84. <ItemsRepeater.Layout>
  85. <StackLayout Spacing="10" Orientation="Vertical"/>
  86. </ItemsRepeater.Layout>
  87. <ItemsRepeater.ItemTemplate>
  88. <DataTemplate>
  89. <StackPanel Spacing="10" Orientation="Horizontal"
  90. HorizontalAlignment="Right">
  91. <Border Background="#cfd7ff"
  92. IsVisible="{Binding IsActive}"
  93. Padding="10 5"
  94. Width="50"
  95. CornerRadius="5">
  96. <TextBlock Text="{Binding NumGroup}"
  97. TextAlignment="Center"
  98. HorizontalAlignment="Stretch"
  99. VerticalAlignment="Center"/>
  100. </Border>
  101. <Border Background="#cfd7ff" CornerRadius="5"
  102. Cursor="Hand" Padding="10 5"
  103. Classes="CAFS"
  104. PointerPressed="OnPointerPressed">
  105. <TextBlock Text="{Binding Name}"
  106. TextAlignment="Left"
  107. VerticalAlignment="Center"
  108. TextWrapping="Wrap"/>
  109. </Border>
  110. </StackPanel>
  111. </DataTemplate>
  112. </ItemsRepeater.ItemTemplate>
  113. </ItemsRepeater>
  114. </StackPanel>
  115. </Grid>
  116. </StackPanel>
  117. </ScrollViewer>
  118. </UserControl>