DragAndDropPage.xaml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <UserControl x:Class="ControlCatalog.Pages.DragAndDropPage"
  2. xmlns="https://github.com/avaloniaui"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  4. <StackPanel Orientation="Vertical" Spacing="4">
  5. <TextBlock Classes="h2">Example of Drag+Drop capabilities</TextBlock>
  6. <WrapPanel HorizontalAlignment="Center">
  7. <StackPanel Margin="8"
  8. MaxWidth="160">
  9. <Border Name="DragMeText"
  10. Padding="16"
  11. BorderBrush="{DynamicResource SystemAccentColor}"
  12. BorderThickness="2">
  13. <TextBlock Name="DragStateText" TextWrapping="Wrap">Drag Me (text)</TextBlock>
  14. </Border>
  15. <Border Name="DragMeFiles"
  16. Padding="16"
  17. BorderBrush="{DynamicResource SystemAccentColor}"
  18. BorderThickness="2">
  19. <TextBlock Name="DragStateFiles" TextWrapping="Wrap">Drag Me (files)</TextBlock>
  20. </Border>
  21. <Border Name="DragMeCustom"
  22. Padding="16"
  23. BorderBrush="{DynamicResource SystemAccentColor}"
  24. BorderThickness="2">
  25. <TextBlock Name="DragStateCustom" TextWrapping="Wrap">Drag Me (custom)</TextBlock>
  26. </Border>
  27. <TextBlock Name="DropState" TextWrapping="Wrap" />
  28. </StackPanel>
  29. <StackPanel Margin="8"
  30. Orientation="Horizontal"
  31. Spacing="16">
  32. <Border Name="CopyTarget"
  33. Padding="16"
  34. MaxWidth="260"
  35. Background="{DynamicResource SystemAccentColorDark1}"
  36. DragDrop.AllowDrop="True">
  37. <TextBlock TextWrapping="Wrap">Drop some text or files here (Copy)</TextBlock>
  38. </Border>
  39. <Border Name="MoveTarget"
  40. Padding="16"
  41. MaxWidth="260"
  42. Background="{DynamicResource SystemAccentColorDark1}"
  43. DragDrop.AllowDrop="True">
  44. <TextBlock TextWrapping="Wrap">Drop some text or files here (Move)</TextBlock>
  45. </Border>
  46. </StackPanel>
  47. </WrapPanel>
  48. </StackPanel>
  49. </UserControl>