Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functional Recommendations:ctrl+drag #478

Closed
DR-ShenSSR opened this issue Nov 18, 2023 · 2 comments
Closed

Functional Recommendations:ctrl+drag #478

DR-ShenSSR opened this issue Nov 18, 2023 · 2 comments
Labels

Comments

@DR-ShenSSR
Copy link

Functional Recommendations
Is there a ctrl+drag that allows copy insertion? I think this would be helpful for separate object manipulation, for example to help chapter catalogs to be built through existing templates

@DR-ShenSSR DR-ShenSSR added the Bug label Nov 18, 2023
@DR-ShenSSR
Copy link
Author

First of all thanks for the existence of such a great plugin.
I get conflicts with the program when I write the following code:
Private Shared Sub StartDragDrop(row As DataGridRow)
If row IsNot Nothing Then
SetIsDragging(row, True)
If Keyboard.IsKeyDown(Key.LeftCtrl) OrElse Keyboard.IsKeyDown(Key.RightShift) Then
' Hold Ctrl to drag and drop as copy and add the
DragDrop.DoDragDrop(row, row.Item, DragDropEffects.Copy)
End If
End If
End Sub

@punker76
Copy link
Owner

punker76 commented Dec 5, 2024

There is a clone sample in the main sample application

<DockPanel LastChildFill="True">
<TextBlock DockPanel.Dock="Top"
Style="{StaticResource SampleHeaderTextBlockStyle}"
Text="Cloning" />
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
<StackPanel>
<TextBlock Style="{StaticResource DefaultTextBlockStyle}" Text="Demonstrates the cloning behaviour with 2 ListBoxes bound to collections of the same type. The Model of the collections implements the ICloneable interface. You can clone an Item by holding the CTRL key while drag and drop." />
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ListBox x:Name="LeftClonableListBox"
Grid.Row="0"
Grid.Column="0"
HorizontalContentAlignment="Stretch"
dd:DragDrop.DragAdornerTemplate="{StaticResource CloningTemplate}"
dd:DragDrop.DragDropCopyKeyState="ControlKey"
dd:DragDrop.IsDragSource="True"
dd:DragDrop.IsDropTarget="True"
dd:DragDrop.UseDefaultEffectDataTemplate="True"
ItemContainerStyle="{StaticResource ClonableListBoxItemStyle}"
ItemTemplate="{StaticResource CloningTemplate}"
ItemsSource="{Binding Data.ClonableCollection1}" />
<ListBox x:Name="RightClonableListBox"
Grid.Row="0"
Grid.Column="1"
HorizontalContentAlignment="Stretch"
dd:DragDrop.DragAdornerTemplate="{StaticResource CloningTemplate}"
dd:DragDrop.DragDropCopyKeyState="ControlKey"
dd:DragDrop.IsDragSource="True"
dd:DragDrop.IsDropTarget="True"
ItemContainerStyle="{StaticResource ClonableListBoxItemStyle}"
ItemTemplate="{StaticResource CloningTemplate}"
ItemsSource="{Binding Data.ClonableCollection2}" />
<views:SettingsView Grid.Row="1"
Grid.Column="0"
Caption="Customization (for left ListBox)"
DataContext="{x:Reference LeftClonableListBox}" />
<views:SettingsView Grid.Row="1"
Grid.Column="1"
Caption="Customization (for right ListBox)"
DataContext="{x:Reference RightClonableListBox}" />
</Grid>
</StackPanel>
</ScrollViewer>
</DockPanel>

@punker76 punker76 closed this as completed Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants