зеркало из https://github.com/telerik/xaml-sdk.git
45 строки
1.7 KiB
XML
45 строки
1.7 KiB
XML
<Window x:Class="CustomListBoxDragDropBehavior.MainWindow"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
|
|
xmlns:local="clr-namespace:CustomListBoxDragDropBehavior"
|
|
Title="MainWindow" Height="350" Width="525">
|
|
<Window.Resources>
|
|
<local:CustomerViewModel x:Key="CustomerViewModel"/>
|
|
<Style x:Key="DraggableListBoxItem" TargetType="telerik:RadListBoxItem">
|
|
<Setter Property="telerik:DragDropManager.AllowCapturedDrag" Value="True" />
|
|
</Style>
|
|
</Window.Resources>
|
|
|
|
<Grid DataContext="{StaticResource CustomerViewModel}">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
<telerik:RadListBox ItemContainerStyle="{StaticResource DraggableListBoxItem}"
|
|
ItemsSource="{Binding Customers1}"
|
|
DisplayMemberPath="Name"
|
|
Grid.Column="0"
|
|
Grid.Row="0"
|
|
Margin="20">
|
|
<telerik:RadListBox.DragVisualProvider>
|
|
<telerik:ScreenshotDragVisualProvider />
|
|
</telerik:RadListBox.DragVisualProvider>
|
|
<telerik:RadListBox.DragDropBehavior>
|
|
<telerik:ListBoxDragDropBehavior />
|
|
</telerik:RadListBox.DragDropBehavior>
|
|
</telerik:RadListBox>
|
|
|
|
<telerik:RadListBox ItemContainerStyle="{StaticResource DraggableListBoxItem}"
|
|
ItemsSource="{Binding Customers2}"
|
|
DisplayMemberPath="Name"
|
|
Grid.Column="1"
|
|
Grid.Row="0"
|
|
Margin="20">
|
|
<telerik:RadListBox.DragDropBehavior>
|
|
<local:MyListBoxDragDropBehavior/>
|
|
</telerik:RadListBox.DragDropBehavior>
|
|
</telerik:RadListBox>
|
|
</Grid>
|
|
</Window>
|