-
Notifications
You must be signed in to change notification settings - Fork 3
/
DragDrop.axaml
44 lines (42 loc) · 2.28 KB
/
DragDrop.axaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:i="clr-namespace:Avalonia.Xaml.Interactivity;assembly=Avalonia.Xaml.Interactivity"
xmlns:iac="clr-namespace:Avalonia.Xaml.Interactions.Custom;assembly=Avalonia.Xaml.Interactions.Custom"
xmlns:idd="clr-namespace:Avalonia.Xaml.Interactions.DragAndDrop;assembly=Avalonia.Xaml.Interactions.DragAndDrop">
<Style Selector="DataGrid.dragging-up DataGridRow.dragging">
<Setter Property="AdornerLayer.Adorner">
<Template>
<Border BorderThickness="0 2 0 0" BorderBrush="Black" />
</Template>
</Setter>
</Style>
<Style Selector="DataGrid.dragging-down DataGridRow.dragging">
<Setter Property="AdornerLayer.Adorner">
<Template>
<Border BorderThickness="0 0 0 2" BorderBrush="Black" />
</Template>
</Setter>
</Style>
<Style Selector="DataGrid.draggable DataGridRow">
<Setter Property="DragDrop.AllowDrop" Value="True" />
<Setter Property="(i:Interaction.Behaviors)">
<i:BehaviorCollectionTemplate>
<i:BehaviorCollection>
<idd:ContextDragBehavior />
<iac:RoutedEventTriggerBehavior RoutedEvent="{x:Static DragDrop.DragEnterEvent}"
RoutingStrategies="Bubble">
<iac:AddClassAction ClassName="dragging" RemoveIfExists="True" />
</iac:RoutedEventTriggerBehavior>
<iac:RoutedEventTriggerBehavior RoutedEvent="{x:Static DragDrop.DragLeaveEvent}"
RoutingStrategies="Bubble">
<iac:RemoveClassAction ClassName="dragging" />
</iac:RoutedEventTriggerBehavior>
<iac:RoutedEventTriggerBehavior RoutedEvent="{x:Static DragDrop.DropEvent}"
RoutingStrategies="Bubble">
<iac:RemoveClassAction ClassName="dragging" />
</iac:RoutedEventTriggerBehavior>
</i:BehaviorCollection>
</i:BehaviorCollectionTemplate>
</Setter>
</Style>
</Styles>