EditorArrangement.axaml 2.5 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.EditorArrangement"
  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.ArrangmentCategory}"
  14. SelectedItem="{Binding EditorPages.TaskEditorPage.SelectedArrangmentCategory}"/>
  15. </StackPanel>
  16. <ItemsRepeater ItemsSource="{Binding EditorPages.TaskEditorPage.ArrangementElement}"
  17. HorizontalAlignment="Stretch"
  18. VerticalAlignment="Stretch">
  19. <ItemsRepeater.Layout>
  20. <StackLayout Spacing="5" Orientation="Vertical"/>
  21. </ItemsRepeater.Layout>
  22. <ItemsRepeater.ItemTemplate>
  23. <DataTemplate>
  24. <WrapPanel Orientation="Horizontal">
  25. <Button Content="х"
  26. Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).EditorPages.TaskEditorPage.DeleteItem}"
  27. CommandParameter="{Binding}"
  28. IsVisible="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).EditorPages.TaskEditorPage.NoEditing}"
  29. VerticalAlignment="Center" />
  30. <NumericUpDown Value="{Binding Position}" Margin="10 0"
  31. MinWidth="150" Minimum="1"
  32. Maximum="{Binding $parent[ItemsRepeater].Children.Count}"/>
  33. <TextBox Text="{Binding Name}"
  34. Width="300" Height="80"/>
  35. </WrapPanel>
  36. </DataTemplate>
  37. </ItemsRepeater.ItemTemplate>
  38. </ItemsRepeater>
  39. <Button Content="Добавить вариант ответа"
  40. IsVisible="{Binding EditorPages.TaskEditorPage.NoEditing}"
  41. Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).EditorPages.TaskEditorPage.AddItem}"
  42. HorizontalAlignment="Center"/>
  43. </StackPanel>
  44. </UserControl>