12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
- x:Class="EntranseTesting.TestArrangementOfElements"
- x:DataType="vm:MainWindowViewModel"
- xmlns:vm="using:EntranseTesting.ViewModels">
- <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
- <StackPanel Margin="20 0" Background="Transparent" Spacing="15"
- HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
- <!-- Задание -->
- <TextBlock Text="{Binding TestMain.TestPages.TestAE.Question}"
- VerticalAlignment="Top"
- HorizontalAlignment="Stretch"
- TextWrapping="Wrap"/>
- <!-- Картинки -->
- <ItemsRepeater ItemsSource="{Binding TestMain.TestPages.TestAE.QImage}"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch">
- <ItemsRepeater.Layout>
- <WrapLayout HorizontalSpacing="15" VerticalSpacing="5" Orientation="Horizontal"/>
- </ItemsRepeater.Layout>
- <ItemsRepeater.ItemTemplate>
- <DataTemplate>
- <Image Source="{Binding qImage}" Classes="Test"/>
- </DataTemplate>
- </ItemsRepeater.ItemTemplate>
- </ItemsRepeater>
- <!-- Поля с перетаскиванием -->
- <Grid Name="MainContainer" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
- <Border DragDrop.AllowDrop="True"
- CornerRadius="5" Background="Transparent" BorderThickness="0" Margin="0 5">
- <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
- <ItemsRepeater ItemsSource="{Binding TestMain.TestPages.TestAE.Element}"
- VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
- <ItemsRepeater.Layout>
- <StackLayout Spacing="10" Orientation="{Binding TestMain.TestPages.TestAE.StackLayoutOrientation}"/>
- </ItemsRepeater.Layout>
- <ItemsRepeater.ItemTemplate>
- <DataTemplate>
- <Border PointerPressed="OnPointerPressed"
- Padding="10 5" Margin="0 0 0 15"
- Classes="Arrangment"
- HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
- Background="#cfd7ff" CornerRadius="5">
- <TextBlock Text="{Binding Name}"
- TextAlignment="Center"
- VerticalAlignment="Center"
- TextWrapping="Wrap"/>
- </Border>
- </DataTemplate>
- </ItemsRepeater.ItemTemplate>
- </ItemsRepeater>
- </ScrollViewer>
- </Border>
- </Grid>
- <!-- Полупрозрачный элемент == перетаскиваемому объекту -->
- <Border Name="GhostItem"
- Padding="10 5" CornerRadius="5"
- Classes="Arrangment"
- Background="#cfd7ff" Opacity="0.6"
- HorizontalAlignment="Center" VerticalAlignment="Center">
- <TextBlock Text="{Binding TestMain.TestPages.TestAE.DraggingElementItem.Name, FallbackValue='TEXT'}"
- Foreground="Black"
- TextAlignment="Center"
- TextWrapping="Wrap"
- VerticalAlignment="Center"
- MaxWidth="140"/>
- </Border>
- </StackPanel>
- </ScrollViewer>
- </UserControl>
|