Hi there!
I have a RadDiagram project that I'm currently working on and need a bit of advice on the best approach. Currently, I am listing out an ObservableCollection called CurrentExampleItems and binding it to an ItemsControl, and the DataTemplate is a UserControl of a CustomShape. I'd like to allow users to drag the UserControl from the StackPanel and have it drop on the grid, but to not create a copy. The idea being that there is only one of these ExampleItems that can be placed on the Grid, so if its on the grid, I dont want to show it in the StackPanel.
All examples I've played with our developed include the OnDragInitialize function to create a duplicate object based on the source, but I think I'd have to do something slightly different to enable this.
Any thoughts?
I have a RadDiagram project that I'm currently working on and need a bit of advice on the best approach. Currently, I am listing out an ObservableCollection called CurrentExampleItems and binding it to an ItemsControl, and the DataTemplate is a UserControl of a CustomShape. I'd like to allow users to drag the UserControl from the StackPanel and have it drop on the grid, but to not create a copy. The idea being that there is only one of these ExampleItems that can be placed on the Grid, so if its on the grid, I dont want to show it in the StackPanel.
All examples I've played with our developed include the OnDragInitialize function to create a duplicate object based on the source, but I think I'd have to do something slightly different to enable this.
Any thoughts?
<StackPanel Background="White" x:Name="stackExampleItems" Orientation="Vertical" telerik:DragDropManager.AllowCapturedDrag="True" > <ItemsControl ItemsSource="{Binding CurrentExampleItems}" > <ItemsControl.ItemTemplate> <DataTemplate> <local:ExampleItemView DataContext="{Binding }" /> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> </StackPanel>