123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <UserControl xmlns="https://github.com/avaloniaui"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:conv="clr-namespace:EntranseTesting.Converter;assembly=EntranseTesting"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
- x:Class="EntranseTesting.EditorMatchesMultiply"
- x:DataType="vm:MainWindowViewModel"
- xmlns:vm="using:EntranseTesting.ViewModels">
- <UserControl.Resources>
- <conv:ItemCAFSConverter x:Key="ItemCAFSConverter"/>
- </UserControl.Resources>
- <StackPanel Orientation="Vertical" Spacing="10">
- <TextBlock Text="Элементы" VerticalAlignment="Center" Margin="0 10"/>
- <ItemsRepeater ItemsSource="{Binding EditorPages.TaskEditorPage.MatchesMultiplyElement}"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch">
- <ItemsRepeater.Layout>
- <StackLayout Spacing="10" Orientation="Vertical"/>
- </ItemsRepeater.Layout>
- <ItemsRepeater.ItemTemplate>
- <DataTemplate>
- <Border BorderBrush="LightCoral" BorderThickness="0 0 0 1">
- <StackPanel Orientation="Horizontal" Spacing="10" HorizontalAlignment="Stretch"
- Name="ElementText">
- <Button Content="x"
- Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).EditorPages.TaskEditorPage.DeleteItem}"
- CommandParameter="{Binding}"
- IsVisible="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).EditorPages.TaskEditorPage.NoEditing}"
- VerticalAlignment="Center" HorizontalAlignment="Center"/>
- <TextBox Width="350" Height="80"
- Margin="10 0"
- Text="{Binding Text}"
- VerticalContentAlignment="Top"/>
- <StackPanel Orientation="Vertical">
- <ItemsRepeater ItemsSource="{Binding ElementEditor}">
- <ItemsRepeater.Layout>
- <StackLayout Spacing="5" Orientation="Vertical"/>
- </ItemsRepeater.Layout>
- <ItemsRepeater.ItemTemplate>
- <DataTemplate>
- <StackPanel Orientation="Horizontal" Spacing="10"
- Name="ElementChoosing">
- <Button Content="x"
- Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).EditorPages.TaskEditorPage.DeleteItemCAFS}"
- CommandParameter="{Binding}"
- IsVisible="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).EditorPages.TaskEditorPage.NoEditing}"
- VerticalAlignment="Center">
- <Button.CommandParameter>
- <MultiBinding Converter="{StaticResource ItemCAFSConverter}">
- <Binding ElementName="ElementText" Path="DataContext"/>
- <Binding ElementName="ElementChoosing" Path="DataContext" />
- </MultiBinding>
- </Button.CommandParameter>
- </Button>
- <CheckBox IsChecked="{Binding Correctly}"
- VerticalAlignment="Center"/>
- <TextBox Text="{Binding Name}"
- Width="350" Height="80"/>
- </StackPanel>
- </DataTemplate>
- </ItemsRepeater.ItemTemplate>
- </ItemsRepeater>
- <Button Content="Добавить элемент выбора" Margin="10 0"
- IsVisible="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).EditorPages.TaskEditorPage.NoEditing}"
- Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).EditorPages.TaskEditorPage.AddItemCAFS}"
- CommandParameter="{Binding}"
- VerticalAlignment="Center" HorizontalAlignment="Center"/>
- </StackPanel>
- </StackPanel>
- </Border>
- </DataTemplate>
- </ItemsRepeater.ItemTemplate>
- </ItemsRepeater>
- <Button Content="Добавить элемент"
- IsVisible="{Binding EditorPages.TaskEditorPage.NoEditing}"
- Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).EditorPages.TaskEditorPage.AddItem}"
- HorizontalAlignment="Center"/>
- </StackPanel>
- </UserControl>
|