This repository has been archived by the owner on Oct 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
49 lines (49 loc) · 2.73 KB
/
MainWindow.xaml
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
45
46
47
48
49
<Window x:Class="Drag_Drop_rows.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:mvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:local="clr-namespace:Drag_Drop_rows"
xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys"
Title="MainWindow" Height="350" Width="700" WindowStartupLocation="CenterScreen" >
<Window.Resources>
<DataTemplate x:Key="dragElementTemplate">
<ItemsControl Opacity="0.75" ItemsSource="{Binding DraggingRows}" Grid.Column="1">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Image Source="{Binding ImageSource}"
Width="{Binding Width}"
Height="{Binding Height}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
</Window.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<dxg:GridControl AutoPopulateColumns="True" Grid.Column="0" Name="gridControl">
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="Name" />
<dxg:GridColumn FieldName="IsComplete" />
</dxg:GridControl.Columns>
<dxg:GridControl.View>
<dxg:TableView Name="tableView1" ShowTotalSummary="True" MultiSelectMode="Row" EditorShowMode="MouseUpFocused" ShowGroupPanel="False" />
</dxg:GridControl.View>
<mvvm:Interaction.Behaviors>
<local:CustomGridDragDropManager DragElementTemplate="{StaticResource dragElementTemplate}" Drop="CustomGridDragDropManager_Drop" />
</mvvm:Interaction.Behaviors>
</dxg:GridControl>
<dxg:TreeListControl AutoPopulateColumns="True" Grid.Column="1" Name="treeList">
<dxg:TreeListControl.View>
<dxg:TreeListView Name="treeListView1" ShowTotalSummary="True" MultiSelectMode="Row" EditorShowMode="MouseUpFocused"
KeyFieldName="ID" ParentFieldName="ParentID" />
</dxg:TreeListControl.View>
<mvvm:Interaction.Behaviors>
<local:CustomTreeListDragDropManager DragElementTemplate="{StaticResource dragElementTemplate}" Drop="CustomTreeListDragDropManager_Drop" />
</mvvm:Interaction.Behaviors>
</dxg:TreeListControl>
</Grid>
</Window>