EditorMatches.axaml 4.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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.EditorMatches"
  7. x:DataType="vm:MainWindowViewModel"
  8. xmlns:vm="using:EntranseTesting.ViewModels">
  9. <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled">
  10. <StackPanel Orientation="Vertical" Spacing="10">
  11. <StackPanel Orientation="Vertical" Spacing="5">
  12. <TextBlock Text="Вид соотношения" VerticalAlignment="Center"/>
  13. <ComboBox Width="450"
  14. IsEnabled="{Binding EditorPages.TaskEditorPage.EditingCategory}"
  15. ItemsSource="{Binding EditorPages.TaskEditorPage.MatchCategory}"
  16. SelectedItem="{Binding EditorPages.TaskEditorPage.SelectedMatchCategory}"/>
  17. </StackPanel>
  18. <Grid>
  19. <Grid.ColumnDefinitions>
  20. <ColumnDefinition Width="50" SharedSizeGroup="A"/>
  21. <ColumnDefinition Width="350" SharedSizeGroup="B"/>
  22. <ColumnDefinition Width="20"/>
  23. <ColumnDefinition Width="350" SharedSizeGroup="C"/>
  24. </Grid.ColumnDefinitions>
  25. <Grid.RowDefinitions>
  26. <RowDefinition Height="Auto"/>
  27. <RowDefinition Height="Auto"/>
  28. </Grid.RowDefinitions>
  29. <StackPanel Orientation="Vertical" Spacing="5" Grid.Column="1"
  30. IsVisible="{Binding EditorPages.TaskEditorPage.SelectedGroup}">
  31. <TextBlock Text="Группа 1" VerticalAlignment="Center"
  32. HorizontalAlignment="Center" Width="350"/>
  33. <TextBox Width="350"
  34. Text="{Binding EditorPages.TaskEditorPage.MatchesGroup1.Name}"/>
  35. </StackPanel>
  36. <StackPanel Orientation="Vertical" Spacing="5" Grid.Column="3"
  37. IsVisible="{Binding EditorPages.TaskEditorPage.SelectedGroup}">
  38. <TextBlock Text="Группа 2" VerticalAlignment="Center"
  39. HorizontalAlignment="Center" Width="350"/>
  40. <TextBox Width="350"
  41. Text="{Binding EditorPages.TaskEditorPage.MatchesGroup2.Name}"/>
  42. </StackPanel>
  43. <TextBlock Text="Элементы" VerticalAlignment="Center"
  44. HorizontalAlignment="Center"
  45. Grid.Row="1" Grid.ColumnSpan="4"
  46. Margin="0 5"/>
  47. </Grid>
  48. <ItemsRepeater ItemsSource="{Binding EditorPages.TaskEditorPage.MatchesElement}"
  49. HorizontalAlignment="Stretch"
  50. VerticalAlignment="Stretch">
  51. <ItemsRepeater.Layout>
  52. <StackLayout Spacing="5" Orientation="Vertical"/>
  53. </ItemsRepeater.Layout>
  54. <ItemsRepeater.ItemTemplate>
  55. <DataTemplate>
  56. <Grid>
  57. <Grid.ColumnDefinitions>
  58. <ColumnDefinition Width="50" SharedSizeGroup="A"/>
  59. <ColumnDefinition Width="350" SharedSizeGroup="B"/>
  60. <ColumnDefinition Width="20"/>
  61. <ColumnDefinition Width="350" SharedSizeGroup="C"/>
  62. </Grid.ColumnDefinitions>
  63. <Button Content="х" Grid.Column="0"
  64. Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).EditorPages.TaskEditorPage.DeleteItem}"
  65. CommandParameter="{Binding}"
  66. IsVisible="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).EditorPages.TaskEditorPage.NoEditing}"
  67. VerticalAlignment="Center" HorizontalAlignment="Center"/>
  68. <StackPanel Orientation="Vertical" Spacing="5" Grid.Column="1">
  69. <TextBox Width="350" Height="80"
  70. Text="{Binding Name1}"/>
  71. </StackPanel>
  72. <StackPanel Orientation="Vertical" Spacing="5" Grid.Column="3">
  73. <TextBox Width="350" Height="80"
  74. Text="{Binding Name2}"/>
  75. </StackPanel>
  76. </Grid>
  77. </DataTemplate>
  78. </ItemsRepeater.ItemTemplate>
  79. </ItemsRepeater>
  80. <Button Content="Добавить пару"
  81. IsVisible="{Binding EditorPages.TaskEditorPage.NoEditing}"
  82. Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).EditorPages.TaskEditorPage.AddItem}"
  83. HorizontalAlignment="Center"/>
  84. </StackPanel>
  85. </ScrollViewer>
  86. </UserControl>