﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - HierarchicalDataTemplate</title><link>http://www.intersoftsolutions.com/Community/Tags/HierarchicalDataTemplate/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Drag Drog Issue / Question</title><link>http://www.intersoftsolutions.com/Community/Tags/HierarchicalDataTemplate/</link><pubDate>Thu, 29 Sep 2011 13:42:01 GMT</pubDate><dc:creator>Syllus</dc:creator><category>DragDrop</category><category>DataTemplate</category><category>HierarchicalDataTemplate</category><category>DragDropBehavior</category><description>&lt;p /&gt;
&lt;p&gt;I am having a slight issue with DataTemplates and the &amp;lt;Intersoft:DragDropBehavior/&amp;gt; behavior.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I have 2 collections in 2 different tabitems of a tab control.  &lt;/p&gt;
&lt;p&gt;The first collection is a list of text labels that the user should be able to drag onto the drawing surface.  For this, I have used a UXListBox Bound to a collection of labels.  My ItemTemplate for the UXListBox is as follows:&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;        &amp;lt;DataTemplate x:Key="TextLibTemplate"&amp;gt;
            &amp;lt;Border&amp;gt;
                &amp;lt;StackPanel Orientation="Horizontal" &amp;gt;
                    &amp;lt;TextBlock Text="{Binding Text}" FontSize="14" Tag="TextLib"&amp;gt;
                        &amp;lt;i:Interaction.Behaviors&amp;gt;
                            &amp;lt;Intersoft:DragDropBehavior DragDropScope="Global" /&amp;gt;
                        &amp;lt;/i:Interaction.Behaviors&amp;gt;
                    &amp;lt;/TextBlock&amp;gt;
                &amp;lt;/StackPanel&amp;gt;
            &amp;lt;/Border&amp;gt;
        &amp;lt;/DataTemplate&amp;gt;&lt;/pre&gt;
&lt;p&gt; The DragDrop functionality works perfectly for this.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;However my 2nd list is a Hierarchical list of symbols that the user can drag onto the sketch surface, and for this I have used a UXTreeView control.  I am using an &amp;lt;Intersoft:HierarchicalDataTemplate/&amp;gt; for the ItemTemplate on this UXTreeView.  The HierarchicalDataTemplate is as follows:&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;        &amp;lt;Intersoft:HierarchicalDataTemplate x:Key="SymbolLibTemplate" ItemsSource="{Binding Symbols}"&amp;gt;
            &amp;lt;Border&amp;gt;
                &amp;lt;StackPanel Orientation="Horizontal" &amp;gt;
                    &amp;lt;TextBlock Text="{Binding Name}" FontSize="14" Foreground="Blue" /&amp;gt;
                    &amp;lt;i:Interaction.Behaviors&amp;gt;
                        &amp;lt;Intersoft:DragDropBehavior IsDragable="False" /&amp;gt;
                    &amp;lt;/i:Interaction.Behaviors&amp;gt;
                &amp;lt;/StackPanel&amp;gt;
            &amp;lt;/Border&amp;gt;
            &amp;lt;Intersoft:HierarchicalDataTemplate.ItemTemplate&amp;gt;
                &amp;lt;Intersoft:HierarchicalDataTemplate&amp;gt;
                    &amp;lt;Border&amp;gt;
                        &amp;lt;StackPanel Orientation="Horizontal"&amp;gt;
                            &amp;lt;Image Width="24" Height="24" Source="Assets/Images/icons/Symbols.png" /&amp;gt;
                            &amp;lt;TextBlock Text="{Binding Name}" FontSize="14" Tag="SymbolLib" /&amp;gt;
                            &amp;lt;i:Interaction.Behaviors&amp;gt;
                                &amp;lt;Intersoft:DragDropBehavior IsDragable="True" DragDropScope="Global" /&amp;gt;
                            &amp;lt;/i:Interaction.Behaviors&amp;gt;
                        &amp;lt;/StackPanel&amp;gt;
                    &amp;lt;/Border&amp;gt;
                &amp;lt;/Intersoft:HierarchicalDataTemplate&amp;gt;
            &amp;lt;/Intersoft:HierarchicalDataTemplate.ItemTemplate&amp;gt;
        &amp;lt;/Intersoft:HierarchicalDataTemplate&amp;gt;&lt;/pre&gt;
&lt;p&gt; The Hierarchial list groups and list items show up in the UXTreeView control perfectly, however the DragDrop behavior has no effect here and does not work.&lt;/p&gt;
&lt;p&gt;I have tried this in a very simplified manner as well using a HierarchicalDataTemplate like:&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;        &amp;lt;Intersoft:HierarchicalDataTemplate x:Key="SymbolLibTemplate2"&amp;gt;
            &amp;lt;Border&amp;gt;
                &amp;lt;StackPanel Orientation="Horizontal" &amp;gt;
                    &amp;lt;TextBlock Text="{Binding Name}" FontSize="14" Tag="SymbolLib"&amp;gt;
                        &amp;lt;i:Interaction.Behaviors&amp;gt;
                            &amp;lt;Intersoft:DragDropBehavior DragDropScope="Global" /&amp;gt;
                        &amp;lt;/i:Interaction.Behaviors&amp;gt;
                    &amp;lt;/TextBlock&amp;gt;
                &amp;lt;/StackPanel&amp;gt;
            &amp;lt;/Border&amp;gt;
        &amp;lt;/Intersoft:HierarchicalDataTemplate&amp;gt;&lt;/pre&gt;
&lt;p&gt; to ensure that the additional complexity of the Hierarchical DataTemplate was not causing a problem.&lt;/p&gt;
&lt;p&gt;The &amp;lt;Intersoft:DragDropBehavior/&amp;gt; just flat out, does not appear to work with the &amp;lt;Intersoft:HierarchicalDataTemplate/&amp;gt;.  Which is preventing the DragDrop behavior from working at all with the UXTreeView.&lt;/p&gt;
&lt;p&gt;Can you see anything that I am doing wrong here that may explain why I am not getting any kind of DragDrop behavior when i use the &amp;lt;Intersoft:HierarchicalDataTemplate/&amp;gt; as apposed to a regular &amp;lt;DataTemplat/&amp;gt;?&lt;/p&gt;
&lt;p&gt;Just as an FYI, here is the main sketch surface of the application where both the text label adn symbol items are dropped.  Again the text labels using a UXListBox and a normal &amp;lt;DataTemplate/&amp;gt; work perfectly, however the UXTreeView using a &amp;lt;Intersoft:HierarchicalDataTemplate/&amp;gt; does not work at all.&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;          &amp;lt;Intersoft:UXFrame x:Name="SketchFrame" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Content="{Binding SketchPad}" MouseEnter="SketchFrame_MouseEnter" Cursor="None"&amp;gt;
                    &amp;lt;i:Interaction.Behaviors&amp;gt;
                        &amp;lt;Intersoft:DropTargetBehavior AllowDropItem="True" DropBehavior="Custom" Drop="SketchFrame_Drop" /&amp;gt;
                    &amp;lt;/i:Interaction.Behaviors&amp;gt;
          &amp;lt;/Intersoft:UXFrame&amp;gt;&lt;/pre&gt;
&lt;p&gt; Thank you in advance for any insight you may be able to provide that will help me get this working with the UXTreeView.&lt;/p&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;</description></item></channel></rss>