TreeViewDragCue
The visual object used as a DragCue in the TreeView.
Definition
Namespace:Telerik.Windows.Controls.TreeView
Assembly:Telerik.Windows.Controls.Navigation.dll
Syntax:
public class TreeViewDragCue : ItemsControl
Inheritance: objectTreeViewDragCue
Constructors
public TreeViewDragCue()
Fields
DragActionContentProperty
DependencyProperty
Identifies the DragActionContent property.
public static readonly DependencyProperty DragActionContentProperty
DragActionContentTemplateProperty
DependencyProperty
Identifies the DragActionContentTemplate property.
public static readonly DependencyProperty DragActionContentTemplateProperty
DragPreviewVisibilityProperty
DependencyProperty
Identifies the DragPreviewVisibility property.
public static readonly DependencyProperty DragPreviewVisibilityProperty
DragTooltipContentProperty
DependencyProperty
Identifies the DragTooltipContent property.
public static readonly DependencyProperty DragTooltipContentProperty
DragTooltipContentTemplateProperty
DependencyProperty
Identifies the DragTooltipContentTemplate property.
public static readonly DependencyProperty DragTooltipContentTemplateProperty
DragTooltipVisibilityProperty
DependencyProperty
Identifies the DragTooltipVisibility property.
public static readonly DependencyProperty DragTooltipVisibilityProperty
DropImpossibleIconProperty
DependencyProperty
Identifies the DropImpossibleIcon property.
public static readonly DependencyProperty DropImpossibleIconProperty
DropImpossibleIconTemplateProperty
DependencyProperty
Identifies the DropImpossibleIcon property.
public static readonly DependencyProperty DropImpossibleIconTemplateProperty
DropPossibleIconProperty
DependencyProperty
Identifies the DropPossibleIcon property.
public static readonly DependencyProperty DropPossibleIconProperty
DropPossibleIconTemplateProperty
DependencyProperty
Identifies the DropPossibleIconTemplate property.
public static readonly DependencyProperty DropPossibleIconTemplateProperty
IsDropPossibleProperty
DependencyProperty
Identifies the IsDropPossible property.
public static readonly DependencyProperty IsDropPossibleProperty
Properties
Gets or sets the content that will appear in the DragCue and is meant to represent the possible drop action. This is a dependency property.
public object DragActionContent { get; set; }
DragActionContentTemplate
DataTemplate
Gets or sets the template for the DragActionContent. This is a dependency property.
public DataTemplate DragActionContentTemplate { get; set; }
DragPreviewVisibility
Visibility
Gets or sets the visibility of the area showing a the dragged items. This is a dependency property.
public Visibility DragPreviewVisibility { get; set; }
Gets or sets the content that will appear in the tooltip of the DragCue. Often this is the destination item is placed here. This is a dependency property.
public object DragTooltipContent { get; set; }
DragTooltipContentTemplate
DataTemplate
Gets or sets the data template for the DragTooltip content. This is a dependency property.
public DataTemplate DragTooltipContentTemplate { get; set; }
DragTooltipVisibility
Visibility
Gets or sets the visibility of the tooltip showing an icon, action text and a preview of the destination. This is a dependency property.
public Visibility DragTooltipVisibility { get; set; }
Gets or sets the content that will appear as an icon when the a drop is not possible. This is a dependency property.
public object DropImpossibleIcon { get; set; }
DropImpossibleIconTemplate
DataTemplate
Gets or sets the data template of the object that will be shown when a drop is not possible. This is a dependency property.
public DataTemplate DropImpossibleIconTemplate { get; set; }
Gets or sets the content that will appear as an icon when the a drop is possible. This is a dependency property.
public object DropPossibleIcon { get; set; }
DropPossibleIconTemplate
DataTemplate
Gets or sets the data template of the object that will be shown when a drop is possible. This is a dependency property.
public DataTemplate DropPossibleIconTemplate { get; set; }
Gets or sets a value indicating whether a drop is possible. This value only changes the DragCue and may not be related to whether a drop could actually happen. This is a dependency property.
public bool IsDropPossible { get; set; }
Methods
Updates the visual state of the control.
protected void ChangeVisualState(bool useTransitions)
Indicates whether transitions should be used.
Return a non-visual representation of an item. This is helpful when DragPreview of visual items needs to be shown.
public static object GetNonVisualRepresentation(object item)
The item to return non-visual representation for.
Returns:A non-visual representation of an item.
The NonVisual representation will fallback like so, trying to return:
- Non-visual Header of Headered Controls
- Non-visual Content of Content Controls
- Non-visual DataContext
- TextSearch.Text Property
- Item itself.
Called when the control template is applied; used to initialize the TreeView drag cue.
public override void OnApplyTemplate()
Raises the event. This method is invoked whenever is set to true internally.
protected override void OnInitialized(EventArgs e)
The RoutedEventArgs that contains the event data.
Resets the theme of the TreeViewDragCue.
public void ResetTheme()
Sets the ItemsSource, extract non-visual representation of all visual items to avoid errors.
public void SetSafeItemsSource(IEnumerable itemsSource)
The items that will be shown in the preview area.
Since visual items cannot be present at two places at the same time, this method will assign an ItemsSource but before that it will try to find a non-visual representation of the visual items.
If the items are non-visual, it keeps them. Then it checks for explicit DataContext of the item. If it has one, it uses it. Then, it checks for the TextSearch.Text property. If it is not set, it returns the ToString() of the item.
Please note that the method does a collection-equals check for and it will not replace the current ItemsSource if the same items are in the new and the old collection. This means that a new ItemsSource will not be set if the new items are just a rearrangement of the old.