Browse Source

Improve DragAndDropPage

pull/20926/head
Julien Lebosquain 7 days ago
parent
commit
9b372c155f
No known key found for this signature in database GPG Key ID: 1833CAD10ACC46FD
  1. 4
      samples/ControlCatalog/Pages/DragAndDropPage.xaml
  2. 3
      samples/ControlCatalog/Pages/DragAndDropPage.xaml.cs

4
samples/ControlCatalog/Pages/DragAndDropPage.xaml

@ -43,14 +43,14 @@
MaxWidth="260"
Background="{DynamicResource SystemAccentColorDark1}"
DragDrop.AllowDrop="True">
<TextBlock TextWrapping="Wrap">Drop some text or files here (Copy)</TextBlock>
<TextBlock TextWrapping="Wrap">Drop some text, files, bitmap or custom format here (Copy)</TextBlock>
</Border>
<Border Name="MoveTarget"
Padding="16"
MaxWidth="260"
Background="{DynamicResource SystemAccentColorDark1}"
DragDrop.AllowDrop="True">
<TextBlock TextWrapping="Wrap">Drop some text or files here (Move)</TextBlock>
<TextBlock TextWrapping="Wrap">Drop some text or custom format here (Move)</TextBlock>
</Border>
</StackPanel>
</WrapPanel>

3
samples/ControlCatalog/Pages/DragAndDropPage.xaml.cs

@ -124,6 +124,9 @@ namespace ControlCatalog.Pages
e.DragEffects = e.DragEffects & (DragDropEffects.Copy);
}
if (e.DragEffects == DragDropEffects.None)
return;
if (e.DataTransfer.Contains(DataFormat.Text))
{
DropState.Content = e.DataTransfer.TryGetText();

Loading…
Cancel
Save