Dear Telerik team,
I want to accomplish the following scenario:
I am developing a MVVM + PRISM + RIA application, and there are many views in a shell, I can drag around various entities between different controls (RadGridView, RadTreeView, ListBox).
I have customized the TreeViewDragCue to display the items I am dragging depending by their type, using a template selector. I also use a view model for the TreeViewDragCue instance and I use binding for some of the properties in the MVVM spirit.
Sample:
My problem now is related to the DragActionContentProperty, when I drag the TreeViewDragCue over grid or list, my Hint from the view model is properly displayed. However when I drag it over RadTreeView seems that the RadTreeView override the DragActionContent that I provide via binding from the Hint property of the viewmodel.
Instead of my "smart" message which is built contextually based on the tree item I am hovering and based on the content I am dragging, I ge a generic "Drop in" or "Drop after" or "Drop before", if I check the CallStack I see that the RadTreeView sets this in the DragActionContent property of the TreeViewDragCue.
I am using also a template for the DragActionContent
I want to accomplish the following scenario:
I am developing a MVVM + PRISM + RIA application, and there are many views in a shell, I can drag around various entities between different controls (RadGridView, RadTreeView, ListBox).
I have customized the TreeViewDragCue to display the items I am dragging depending by their type, using a template selector. I also use a view model for the TreeViewDragCue instance and I use binding for some of the properties in the MVVM spirit.
Sample:
Binding hint =
new
Binding(
"Hint"
);
hint.Source =
treeViewCueModel;
hint.Mode =
BindingMode.OneWay;
BindingOperations.SetBinding(treeViewCue,
TreeViewDragCue.DragActionContentProperty, hint);
Binding possibleIcon =
new
Binding(
"PossibleIcon"
);
possibleIcon.Source =
treeViewCueModel;
possibleIcon.Mode =
BindingMode.OneWay;
BindingOperations.SetBinding(treeViewCue,
TreeViewDragCue.DropPossibleIconProperty, possibleIcon);
My problem now is related to the DragActionContentProperty, when I drag the TreeViewDragCue over grid or list, my Hint from the view model is properly displayed. However when I drag it over RadTreeView seems that the RadTreeView override the DragActionContent that I provide via binding from the Hint property of the viewmodel.
Instead of my "smart" message which is built contextually based on the tree item I am hovering and based on the content I am dragging, I ge a generic "Drop in" or "Drop after" or "Drop before", if I check the CallStack I see that the RadTreeView sets this in the DragActionContent property of the TreeViewDragCue.
I am using also a template for the DragActionContent
treeViewCue.DragActionContentTemplate =
TemplateProvider.Resources[
"HintTemplate"
]
as
DataTemplate;
where the template itself is defined like this:
<
DataTemplate
x:Key
=
"HintTemplate"
>
<
TextBlock
Text
=
"{Binding}"
Margin
=
"5"
FontStyle
=
"Italic"
MaxWidth
=
"200"
TextWrapping
=
"Wrap"
>
</
TextBlock
>
</
DataTemplate
>
Is there a way to tell RadTreeView not to override the DragActionContent I am providing to the TreeViewDragCue via binding?
Can you recommend a solution for what I want to accomplish?
Thank you,
Vasile M.