EditorChoosing.axaml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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.EditorChoosing"
  7. x:DataType="vm:MainWindowViewModel"
  8. xmlns:vm="using:EntranseTesting.ViewModels">
  9. <StackPanel Orientation="Vertical" Spacing="10">
  10. <StackPanel Orientation="Vertical" Spacing="5">
  11. <TextBlock Text="Количество правильных значений" VerticalAlignment="Center"/>
  12. <ComboBox Width="450"
  13. ItemsSource="{Binding EditorPages.TaskEditorPage.ChoseCategory}"
  14. SelectedItem="{Binding EditorPages.TaskEditorPage.SelectedChoseCategory}"/>
  15. </StackPanel>
  16. <ItemsRepeater ItemsSource="{Binding EditorPages.TaskEditorPage.ChooseElement}"
  17. HorizontalAlignment="Stretch"
  18. VerticalAlignment="Stretch">
  19. <ItemsRepeater.Layout>
  20. <StackLayout Spacing="5" Orientation="Vertical"/>
  21. </ItemsRepeater.Layout>
  22. <ItemsRepeater.ItemTemplate>
  23. <DataTemplate>
  24. <StackPanel Orientation="Horizontal" Spacing="10">
  25. <CheckBox IsChecked="{Binding Correctly}"
  26. VerticalAlignment="Center"/>
  27. <TextBox Text="{Binding Name}"
  28. Width="350" Height="80"/>
  29. <Button Content="х"
  30. Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).EditorPages.TaskEditorPage.DeleteItem}"
  31. CommandParameter="{Binding}"
  32. IsVisible="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).EditorPages.TaskEditorPage.NoEditing}"
  33. VerticalAlignment="Center" />
  34. </StackPanel>
  35. </DataTemplate>
  36. </ItemsRepeater.ItemTemplate>
  37. </ItemsRepeater>
  38. <Button Content="Добавить вариант ответа"
  39. IsVisible="{Binding EditorPages.TaskEditorPage.NoEditing}"
  40. Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).EditorPages.TaskEditorPage.AddItem}"
  41. HorizontalAlignment="Center"/>
  42. </StackPanel>
  43. </UserControl>