I want to modify the default DragSource Template because when I completely override it, like this:
<DataTemplate x:Key="ContentDragTemplate"> <ContentControl Content="{Binding DragImage}" Opacity="0.5"/> </DataTemplate>
then, the DragImage is now centered on where I click instead of appearing from it's original position.
I could write a transform to achieve this, but I figured you guys must have already done this, so why duplicate it.
I have looked in my hard drive for it and have come up empty - I looked here "C:\Program Files (x86)\Infragistics\NetAdvantage 2010.3\Silverlight\Default Styles"
Any help would be greatly appreciated.
thanks,
greg
One more question.. When I try to hide the view that is the DragSource, the image also gets hidden. How can I just hide the DragSource without the image also being hidden. In general, it would be helpful if I were given somewhere to look to see how all this works. The documentation is virtually non-existent.
Can anyone at Infragistics answer this? If you need clarity on what I'm trying to do, it basically mirrors the iGoogle dashboard drag and drop functionality.
PPilev,
This solves my first problem, I was unaware of the DragPop_Opened event, so no need for me to modify the template. As for the second post. I have solved it another way. I basically have an ObservableCollection of UserControl bound to an ItemsControl that represents content on the page. When the user is dragging it, I wanted to either remove it from the collection and replace it with a placeholder that looks like a dotted line filled with shading. Instead of removing or hiding the view, I just find it's position and overlay the place holder on top of it, which is actually a better design. My problems are solved and my drag and drop is working great. If you want an example of what I do, it's very similar to the iGoogle page, except mine auto scrolls when you are dragging.
thank you.
-greg
Hello,
If your goal is only to change the Opacity of the content then you can modify it when the popup is opened:
private void DragSource_DragStart(object sender, DragDropStartEventArgs e)
{
if (DragDropManager.DragPopup != null)
DragDropManager.DragPopup.Opened += this.DragPopup_Opened;
}
private void DragPopup_Opened(object sender, EventArgs e)
DragDropManager.DragPopup.Opened -= this.DragPopup_Opened;
DragDropManager.DragPopup.Child.Opacity = 0.5;
We will consider to expose a properties to control the horizontal and vertical offset of the popup relative to the mouse position when there is drag template applied.
About your second post: could you sent me a sample scenario. We’ve made some improvements about the drag-and-drop if the drag source element is unloaded. I can check if it works for your case and I also will check in which version of control it takes into account.
Best regards.
PPilev.