<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	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/"
	>

<channel>
	<title>drag-and-drop &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://wordpress.com/tag/drag-and-drop/</link>
	<description>Feed of posts on WordPress.com tagged "drag-and-drop"</description>
	<pubDate>Tue, 14 Oct 2008 08:33:40 +0000</pubDate>

	<generator>http://wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Drag and Drop between two Infragistics grids]]></title>
<link>http://dineshnano.wordpress.com/?p=22</link>
<pubDate>Tue, 07 Oct 2008 05:58:11 +0000</pubDate>
<dc:creator>dineshnano</dc:creator>
<guid>http://dineshnano.wordpress.com/2008/10/07/drag-and-drop-between-two-infragistics-grids/</guid>
<description><![CDATA[ 
I had the need to allow a user in a multi-document environment to drag rows between Infragistics ]]></description>
<content:encoded><![CDATA[<p> </p>
<p>I had the need to allow a user in a multi-document environment to drag rows between Infragistics UltraGrid instances.  My needs involved grids accessing the same data with a filter that differed only by the specific filter value.</p>
<p>The Infragistics website has a simplistic example of doing the drag and drop operation, but it lacked information and added unnecessary information.  For example, with their example you would no longer be able to drag a column header into the group by box.  I pieced the various elements together and came up with this solution.  I've modified it from my solution to be as generic as possible.</p>
<ol>
<li>Add a field called <span style="font-family:Courier New;"><strong>m_dragging</strong></span> and a corresponding private property <span style="font-family:Courier New;"><strong>Dragging</strong></span></li>
<li>Initialize the <span style="font-family:Courier New;"><strong>Dragging</strong></span> property to false</li>
<li>Add an event handler for the <span style="font-family:Courier New;"><strong>MouseDown</strong></span> property</li>
<li>Add an event handler for the <strong><span style="font-family:Courier New;">MouseUp</span></strong> property</li>
<li>Add an event handler for the <strong><span style="font-family:Courier New;">MouseMove</span></strong> property</li>
<li>Add an event handler for the <strong><span style="font-family:Courier New;">DragEnter</span></strong> property</li>
<li>Add an event handler for the <strong><span style="font-family:Courier New;">DragDrop</span></strong> property</li>
</ol>
<p>Implement the individual event methods as follows:</p>
<p><span style="font-family:Courier New;">private void myGrid_MouseDown(object sender, MouseEventArgs e)<br />
{<br />
   if (e.Button != MouseButtons.Left)<br />
      return;</p>
<p>   Point gridPoint = new Point(e.X, e.Y);<br />
   UIElement element = myGrid.DisplayLayout.UIElement.ElementFromPoint(gridPoint);</p>
<p>   if (element != null)<br />
   {<br />
      Type selectedType = element.GetContext().GetType();</p>
<p>      if (selectedType == typeof(UltraGridRow)<br />
        &#124;&#124; selectedType == typeof(UltraGridCell)<br />
        &#124;&#124; selectedType == typeof(UltraGridColumn))<br />
         Dragging = true;<br />
   }<br />
}</span></p>
<p><span style="font-family:Courier New;">private void myGrid_MouseUp(object sender, MouseEventArgs e)<br />
{<br />
   Dragging = false;<br />
}</span></p>
<p><span style="font-family:Courier New;">private void myGrid_MouseMove(object sender, MouseEventArgs e)<br />
{<br />
   if (e.Button == MouseButtons.Left &#38;&#38; Dragging<br />
      &#38;&#38; myGrid.Selected.Rows.Count &#62; 0)<br />
   {<br />
      GridRowMoveData moveData = new GridRowMoveData(myGrid);<br />
      myGrid.DoDragDrop(moveData, DragDropEffects.Move);<br />
   }<br />
}</span></p>
<p><span style="font-family:Courier New;">private void myGrid_DragEnter(object sender, DragEventArgs e)<br />
{<br />
   if (e.Data.GetDataPresent(typeof(GridRowMoveData)))<br />
     e.Effect = DragDropEffects.Move;<br />
   else<br />
     e.Effect = DragDropEffects.None;</span><span style="font-family:Courier New;"><br />
}</span></p>
<p><span style="font-family:Courier New;">private void myGrid_DragDrop(object sender, DragEventArgs e)<br />
{<br />
   if (e.Effect == DragDropEffects.Move)<br />
   {<br />
      GridRowMoveData moveData = <br />
         (GridRowMoveData)e.Data.GetData(typeof(GridRowMoveData));<br />
      if(myGrid.Equals(moveData.Source))<br />
         return;   // don't allow drop on same grid</p>
<p>      // perform the specific move operation; in my case I simply<br />
      // changed the foreign key value that was the basis for my<br />
      // filter, because everything was referencing the same<br />
      // data table.<br />
      // TODO:</span><span style="font-family:Courier New;"><br />
   }</span><span style="font-family:Courier New;"><br />
}</span></p>
<p><span style="font-family:Courier New;">using Infragistics.Win.UltraWinGrid;<br />
using System.Data;</span></p>
<p><span style="font-family:Courier New;">public class GridRowMoveData<br />
{<br />
   private UltraGrid m_source;<br />
   private DataRow[] m_rows;</p>
<p>   public GridRowMoveData(UltraGrid source)<br />
   {<br />
     if (source == null)<br />
        throw new ArgumentNullException("source");<br />
</span><span style="font-family:Courier New;"><br />
     m_source = source;<br />
     m_rows = GetRowsFromSource();<br />
   }</p>
<p>   public UltraGrid Source {get{return m_source;}}<br />
   public DataRow[] Rows {get{return m_rows;}}</p>
<p>   private DataRow[] GetRowsFromSource()<br />
   {<br />
      DataRow[] selectedRows = new DataRow[Source.Selected.Rows.Count];<br />
      for (int i = 0; i &#60; Source.Selected.Rows.Count; i++)<br />
      {<br />
         Guid myPrimaryKey = (Guid)Source.Selected.Rows[i].Cells["MyKey"].Value;<br />
         DataTable table = ((DataSet)Source.DataSource).Tables["MyTable"];<br />
         selectedRows[i] = table.Rows.Find(myPrimaryKey);<br />
      }</p>
<p>      return selectedRows;<br />
   }<br />
}</span></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Silverlight 2.0 In Examples: Part ? Drag and Drop Inside Out]]></title>
<link>http://nickssoftwareblog.wordpress.com/?p=275</link>
<pubDate>Tue, 07 Oct 2008 02:08:26 +0000</pubDate>
<dc:creator>npolyak</dc:creator>
<guid>http://nickssoftwareblog.wordpress.com/2008/10/07/silverlight-20-in-examples-part-drag-and-drop-inside-out/</guid>
<description><![CDATA[Introduction
This is a continuation of a tutorial, see Silverlight 2.0 In Examples: Part 0. Introduc]]></description>
<content:encoded><![CDATA[<h2>Introduction</h2>
<p>This is a continuation of a tutorial, see <a href="http://nickssoftwareblog.com/2008/09/23/silverlight-20-in-examples-part-1-introduction/">Silverlight 2.0 In Examples: Part 0. Introduction"</a> and <a href="http://nickssoftwareblog.com/2008/09/23/silverlight-20-in-examples-part-1-overview-of-silverlight-controls/">"Silverlight 2.0 In Examples: Part 1. Silverlight Elements: Panels and Controls</a>.</p>
<p>Since recently I've been working on Silverlight Drag and Drop, I decided to break the continuity of this tutorial and skip several parts, writing right away about how to implement Drag and Drop in Silverlight. In addition to information from the previous sections of the tutorial, this part requires some knowledge of DataTemplates and binding (I will give brief explanations of both).</p>
<p>The article that started me on Silverlight 2.0 Drag and Drop can be accessed via the following link: <a href="http://leeontech.wordpress.com/2008/04/11/drag-and-drop-in-silverlight/">Drag and Drop in Silverlight</a>. At the bottom of the article you can find a link to download the source code.</p>
<p>Here, however, I go over Drag and Drop with more details and examples. A special feature of this article is a Drag and Drop custom control designed to absorb most of the Drag and Drop complexity. Based on this control, I created an example functionally similar to the one described in <a href="http://leeontech.wordpress.com/2008/04/11/drag-and-drop-in-silverlight/">Drag and Drop in Silverlight</a>.</p>
<p>Silverlight demos, including those corresponding to the samples presented here can be found at <a href="http://awebpros.com/index.html?AWebProsDemos.aspx">AWebPros Demos</a>.</p>
<h2>Simple Silverlight Drag and Drop Example</h2>
<p style="text-align:left;">Here is the screen capture of the first example:</p>
<p style="text-align:center;"><a href="http://nickssoftwareblog.files.wordpress.com/2008/10/simpledragdrop.jpg"><img class="size-full wp-image-302    aligncenter" title="simpledragdrop" src="http://nickssoftwareblog.wordpress.com/files/2008/10/simpledragdrop.jpg" alt="" width="430" height="474" /></a></p>
<p>One can drag and drop the red circle anywhere within the Silverlight application area.<br />
The source code for this sample can be downloaded from <a href="http://nickssoftwareblog.files.wordpress.com/2008/10/simpledragdropzip2.doc">simpledragdropzip.doc</a>. As always, please remove .doc extension, rename the file to simpledragdrop.zip and then open it as a zip file.<br />
Below the code of the sample is explained in detail.<br />
Here are the contents of Page.xaml file:</p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0000ff;font-family:&#34;">&#60;</span><span style="font-size:10pt;color:#a31515;font-family:&#34;">UserControl</span><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>   </span><span style="color:#ff0000;"><span> </span>x</span><span style="color:#0000ff;">:</span><span style="color:#ff0000;">Class</span><span style="color:#0000ff;">="SimpleDragDrop.Page" </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0000ff;font-family:&#34;"><span>    </span></span><span style="font-size:10pt;color:#ff0000;font-family:&#34;">xmlns</span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">="http://schemas.microsoft.com/winfx/2006/xaml/presentation"</span><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>   </span><span style="color:#ff0000;"><span> </span>xmlns</span><span style="color:#0000ff;">:</span><span style="color:#ff0000;">x</span><span style="color:#0000ff;">="http://schemas.microsoft.com/winfx/2006/xaml"</span> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>   </span><span style="color:#ff0000;"><span> </span>Background</span><span style="color:#0000ff;">="Yellow"</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>   </span><span style="color:#ff0000;"><span> </span>Width</span><span style="color:#0000ff;">="400"</span> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>   </span><span style="color:#ff0000;"><span> </span>Height</span><span style="color:#0000ff;">="300"&#62;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#a31515;font-family:&#34;"><span>    </span></span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">&#60;</span><span style="font-size:10pt;color:#a31515;font-family:&#34;">UserControl.Resources</span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#a31515;font-family:&#34;"><span>        </span></span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">&#60;</span><span style="font-size:10pt;color:#a31515;font-family:&#34;">DataTemplate</span><span style="font-size:10pt;color:#ff0000;font-family:&#34;"> x</span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">:</span><span style="font-size:10pt;color:#ff0000;font-family:&#34;">Key</span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">="Circle"&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#a31515;font-family:&#34;"><span>            </span></span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">&#60;</span><span style="font-size:10pt;color:#a31515;font-family:&#34;">Ellipse</span><span style="font-size:10pt;color:#ff0000;font-family:&#34;"> Width</span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">="20"</span><span style="font-size:10pt;color:#ff0000;font-family:&#34;"> Height</span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">="20"</span><span style="font-size:10pt;color:#ff0000;font-family:&#34;"> Fill</span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">="Red"&#62;&#60;/</span><span style="font-size:10pt;color:#a31515;font-family:&#34;">Ellipse</span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#a31515;font-family:&#34;"><span>        </span></span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">&#60;/</span><span style="font-size:10pt;color:#a31515;font-family:&#34;">DataTemplate</span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#a31515;font-family:&#34;"><span>    </span></span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">&#60;/</span><span style="font-size:10pt;color:#a31515;font-family:&#34;">UserControl.Resources</span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#a31515;font-family:&#34;"><span>    </span></span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">&#60;</span><span style="font-size:10pt;color:#a31515;font-family:&#34;">Grid</span><span style="font-size:10pt;color:#ff0000;font-family:&#34;"> x</span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">:</span><span style="font-size:10pt;color:#ff0000;font-family:&#34;">Name</span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">="LayoutRoot"</span><span style="font-size:10pt;color:#ff0000;font-family:&#34;"> Background</span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">="White"&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#a31515;font-family:&#34;"><span>        </span></span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">&#60;</span><span style="font-size:10pt;color:#a31515;font-family:&#34;">Popup</span><span style="font-size:10pt;color:#ff0000;font-family:&#34;"> x</span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">:</span><span style="font-size:10pt;color:#ff0000;font-family:&#34;">Name</span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">="MyPopup"</span><span style="font-size:10pt;color:#ff0000;font-family:&#34;">IsOpen</span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">="False"&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#a31515;font-family:&#34;"><span>            </span></span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">&#60;</span><span style="font-size:10pt;color:#a31515;font-family:&#34;">ContentControl</span><span style="font-size:10pt;color:#ff0000;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="text-indent:.5in;margin:0 0 0 .5in;"><span style="font-size:10pt;color:#ff0000;font-family:&#34;"><span>   </span>ContentTemplate</span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">="{</span><span style="font-size:10pt;color:#a31515;font-family:&#34;">StaticResource</span><span style="font-size:10pt;color:#ff0000;font-family:&#34;"> Circle</span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">}"</span><span style="font-size:10pt;color:#ff0000;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="text-indent:.5in;margin:0 0 0 .5in;"><span style="font-size:10pt;color:#ff0000;font-family:&#34;"><span>   </span>Opacity</span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">="0.5"/&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#a31515;font-family:&#34;"><span>        </span></span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">&#60;/</span><span style="font-size:10pt;color:#a31515;font-family:&#34;">Popup</span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#a31515;font-family:&#34;"><span>        </span></span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">&#60;</span><span style="font-size:10pt;color:#a31515;font-family:&#34;">ContentControl</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>           </span><span style="color:#ff0000;"><span> </span>ContentTemplate</span><span style="color:#0000ff;">="{</span><span style="color:#a31515;">StaticResource</span><span style="color:#ff0000;"> Circle</span><span style="color:#0000ff;">}"</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>           </span><span style="color:#ff0000;"><span> </span>x</span><span style="color:#0000ff;">:</span><span style="color:#ff0000;">Name</span><span style="color:#0000ff;">="MyControlToMove"&#62;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#a31515;font-family:&#34;"><span>        </span></span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">&#60;/</span><span style="font-size:10pt;color:#a31515;font-family:&#34;">ContentControl</span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#a31515;font-family:&#34;"><span>    </span></span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">&#60;/</span><span style="font-size:10pt;color:#a31515;font-family:&#34;">Grid</span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">&#62;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0000ff;font-family:&#34;">&#60;/</span><span style="font-size:10pt;color:#a31515;font-family:&#34;">UserControl</span><span style="font-size:10pt;color:#0000ff;font-family:&#34;">&#62;</span><br />
The object that we are dragging and dropping is ContentControl at the very bottom of the XAML file. Its name is "MyControlToMove".</p>
<p class="MsoNormal" style="margin:0;">ContentControl is a control that has two major properties: Content (which contains some data) and ContentTemplate (which specifies how to present this data).</p>
<p class="MsoNormal" style="margin:0;">In our case the presentation of MyControlToMove is not data dependent (Content property does not play any role). This presentation is determined only by the DataTemplate which is defined as a resource called "Circle" within UserControl.Resources section. In this example this ContentControl is always displayed as a red circle.<br />
Another control is used as a drag cursor to show where the circle is dragged. It is represented by a similar red circle with its opacity property set to 0.5, making it semitransparent. This control is of Popup type.</p>
<p>Now, let us deconstruct the C# code. While XAML contains mostly design and static information, C# carries information about actions. There are 3 main actions within the Drag and Drop process:</p>
<li>Drag beginning - occurs when the left mouse button is pressed on a draggable object.</li>
<li>Drag process - occurs when the mouse pointer is moved with the left mouse button still pressed.</li>
<li>Drop - occurs when the left mouse button is released.</li>
<p>Correspondingly, we have 3 event handlers for 3 events:</p>
<li>MouseLeftButtonDown - to handle start of the drag process</li>
<li>MouseMove - to handle visual moving of the dragged item</li>
<li>MouseLeftButtonUp - to handle drop operation</li>
<p>All of the events are registered with the top level panel "LayoutRoot". This is possible because of the event "Bubbling". Even if a child of "LayoutRoot" panel is clicked, the event eventually "bubbles" up to it, unless it is handled before.<br />
Here is how we set the event handlers within the application:</p>
<p class="MsoNormal" style="text-indent:-.5in;text-align:left;margin:0 0 0 .5in;"><span style="font-size:10pt;font-family:&#34;">LayoutRoot.MouseLeftButtonDown += </span></p>
<p class="MsoNormal" style="text-indent:-.5in;text-align:left;margin:0 0 0 .5in;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#0000ff;">new</span> <span style="color:#2b91af;">MouseButtonEventHandler</span>(LayoutRoot_MouseLeftButtonDown);</span></p>
<p class="MsoNormal" style="text-indent:-.5in;text-align:left;margin:0 0 0 .5in;"><span style="font-size:10pt;font-family:&#34;">LayoutRoot.MouseMove += </span></p>
<p class="MsoNormal" style="text-indent:-.5in;text-align:left;margin:0 0 0 .5in;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#0000ff;">new</span> <span style="color:#2b91af;">MouseEventHandler</span>(LayoutRoot_MouseMove);</span></p>
<p class="MsoNormal" style="text-indent:-.5in;text-align:left;margin:0 0 0 .5in;"><span style="font-size:10pt;font-family:&#34;">LayoutRoot.MouseLeftButtonUp += </span></p>
<p class="MsoNormal" style="text-indent:-.5in;text-align:left;margin:0 0 0 .5in;"><span style="font-size:10pt;color:#0000ff;font-family:&#34;"><span>    </span>new</span><span style="font-size:10pt;font-family:&#34;"> <span style="color:#2b91af;">MouseButtonEventHandler</span>(LayoutRoot_MouseLeftButtonUp);</span></p>
<p class="MsoNormal" style="text-indent:-.5in;text-align:left;margin:0 0 0 .5in;"> </p>
<p>Now let us describe these 3 operations in detail.</p>
<h3>Starting the Drag Operation</h3>
<p>Starting the drag operation is handled by the function LayoutRoot_MouseLeftButtonDown which in turn calls StartDragDrop.</p>
<p>Here is the code for LayoutRoot_MouseLeftButtonDown function:</p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0000ff;font-family:&#34;">void</span><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">LayoutRoot_MouseLeftButtonDown(<span style="color:#0000ff;">object</span> sender, </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>                                               </span><span style="color:#2b91af;">MouseButtonEventArgs</span> e)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// obtain all UI elements at the </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;"><span>    </span>// current mouse pointer location</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#2b91af;">List</span>&#60;<span style="color:#2b91af;">UIElement</span>&#62; elements = </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>       </span>(<span style="color:#2b91af;">List</span>&#60;<span style="color:#2b91af;">UIElement</span>&#62;)<span style="color:#0000ff;">this</span>.HitTest(e.GetPosition(<span style="color:#0000ff;">null</span>));</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// get the first element of type Ellipse and </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;"><span>    </span>// start drag operation on it.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#0000ff;">foreach</span> (<span style="color:#2b91af;">UIElement</span> element <span style="color:#0000ff;">in</span> elements)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>        </span><span style="color:#0000ff;">if</span> (element <span style="color:#0000ff;">is</span> <span style="color:#2b91af;">Ellipse</span>)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>        </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>            </span>StartDragDrop(element, e);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>            </span><span style="color:#0000ff;">break</span>;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>        </span>}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">}</span></p>
<p>First HitTest gets all the elements "pierced" by the current mouse pointer. Then we iterate over each of of the elements, find the "Ellipse" (this is our circle we want to move) and start drag operation on it by calling StartDragDrop function.</p>
<p>Here is the StartDragDrop function code:</p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0000ff;font-family:&#34;">private</span><span style="font-size:10pt;font-family:&#34;"> <span style="color:#0000ff;">void</span> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">StartDragDrop(<span style="color:#2b91af;">UIElement</span> element, </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>              </span><span style="color:#2b91af;">MouseButtonEventArgs</span> e)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// make the popup visible</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>MyPopup.IsOpen = <span style="color:#0000ff;">true</span>; </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// make the mouse events connected to </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// the popup</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>MyPopup.CaptureMouse(); </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// figure out the mouse coordinates at the onset </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// of Drag operation.</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>_horisontalOffset = e.GetPosition(<span style="color:#0000ff;">null</span>).X;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>_verticalOffset = e.GetPosition(<span style="color:#0000ff;">null</span>).Y;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// set _captured flag to true</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// (this is to check later if drag drop </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">//<span>  </span>operation is in progress)</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>_captured = <span style="color:#0000ff;">true</span>;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// move the popup to the current mouse location.</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>MyPopup.HorizontalOffset = _horisontalOffset;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>MyPopup.VerticalOffset = _verticalOffset;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">}</span></p>
<p>The StartDragDrop functionality is explained in the comments within its code.</p>
<h3>Drag Operation During the Mouse Move</h3>
<p>Here is how we implemented Drag operation when mouse moves:</p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0000ff;font-family:&#34;">void</span><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">LayoutRoot_MouseMove(<span style="color:#0000ff;">object</span> sender, </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>                     </span><span style="color:#2b91af;">MouseEventArgs</span> e)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// if no drag and drop started, </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// we do not need to do anything.</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#0000ff;">if</span> (!_captured)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>        </span><span style="color:#0000ff;">return</span>;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>   </span><span> </span><span style="color:#008000;">// update the popup location to the </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// current mouse pointer location.</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>MyPopup.HorizontalOffset = e.GetPosition(<span style="color:#0000ff;">null</span>).X;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>MyPopup.VerticalOffset = e.GetPosition(<span style="color:#0000ff;">null</span>).Y;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">}</span></p>
<p>All we need to do is to move the Drag popup to the current location of the mouse pointer. </p>
<h3>Drop Operation</h3>
<p>Finally, here is the function in charge of Drop operation:</p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0000ff;font-family:&#34;">void</span><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">LayoutRoot_MouseLeftButtonUp(<span style="color:#0000ff;">object</span> sender, </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>                             </span><span style="color:#2b91af;">MouseButtonEventArgs</span> e)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// if drag is not started we do not need</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// any drop functionality to execute</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#0000ff;">if</span> (!_captured)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>        </span><span style="color:#0000ff;">return</span>;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// mouse capture is released</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>MyPopup.ReleaseMouseCapture();</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// popup becomes invisible</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>MyPopup.IsOpen = <span style="color:#0000ff;">false</span>;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// set captured flag to false</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// (no drag operation in progress)</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>_captured = <span style="color:#0000ff;">false</span>;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// the rest of the code just moves</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// our content control to the new location</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// using TranslateTransform</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#2b91af;">GeneralTransform</span> gt = </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>        </span><span style="color:#0000ff;">this</span>.TransformToVisual(MyControlToMove);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#2b91af;">Point</span>startPoint = gt.Transform(<span style="color:#0000ff;">new</span> <span style="color:#2b91af;">Point</span>(0, 0));</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#2b91af;">Point</span>p = e.GetPosition(<span style="color:#0000ff;">null</span>);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#2b91af;">TranslateTransform</span>tt = <span style="color:#0000ff;">new</span> <span style="color:#2b91af;">TranslateTransform</span>();</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>tt.X = p.X - _horisontalOffset - startPoint.X;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>tt.Y = p.Y - _verticalOffset - startPoint.Y;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>MyControlToMove.RenderTransform = tt;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">}</span></p>
<p>As you can see, we stop the DragDrop operation by releasing the mouse capture, making the Drag popup invisible and setting _captured flag to false. Then we do the actual drop operation by moving the original dragged control to the new location using TranslateTransform.</p>
<h2>Drag and Drop with Forbidden Area</h2>
<p>Now, let us consider a more complicated example.<br />
In addition to the previously discussed functionality it has the following:</p>
<li>Area in which it is forbidden to drop.</li>
<li>A special template for the Drag popup to appear when the mouse pointer is in the area in which it is forbidden to drop.</li>
<li>The drag operation does not start right away, but only when the mouse is far enough from the origin.</li>
<p>Here is the screen capture for the example:</p>
<p style="text-align:center;"><a href="http://nickssoftwareblog.files.wordpress.com/2008/10/dragdropwithforbiddenarea.jpg"><img class="size-full wp-image-354  aligncenter" title="dragdropwithforbiddenarea" src="http://nickssoftwareblog.wordpress.com/files/2008/10/dragdropwithforbiddenarea.jpg" alt="" width="414" height="432" /></a></p>
<p>The yellow circle signifies the area where the drop is allowed. Outside of it, the drop is forbidden.<br />
Here is the code for the example: <a href="http://nickssoftwareblog.files.wordpress.com/2008/10/dragdropwithforbiddenareazip1.doc">dragdropwithforbiddenareazip.doc</a>.<br />
As one can see from the code, the capture process now begins during MouseMove action and only when the distance between the original and current locations of the mouse is greater than _captureRadius:</p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0000ff;font-family:&#34;">private</span><span style="font-size:10pt;font-family:&#34;"> <span style="color:#0000ff;">void </span>BeginCapture(<span style="color:#2b91af;">MouseEventArgs</span> e)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// check if the mouse pointer position</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// within _captureRadius</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#0000ff;">double </span>diffX = </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>        </span>e.GetPosition(<span style="color:#0000ff;">null</span>).X - _horisontalOffset;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#0000ff;">double </span>diffY = </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>        </span>e.GetPosition(<span style="color:#0000ff;">null</span>).Y - _verticalOffset;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// if it is within _captureRadion, </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// do not start capture</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#0000ff;">if </span>((diffX * diffX + diffY * diffY) &#60;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>        </span>_captureRaduis * _captureRaduis)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>        </span><span style="color:#0000ff;">return</span>;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// make popup visible</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>MyPopup.IsOpen = <span style="color:#0000ff;">true</span>;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// capture mouse</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>MyPopup.CaptureMouse();</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// set _captured flag to true.</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>_captured = <span style="color:#0000ff;">true</span>;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">}</span></p>
<p>There is also a function InAllowedArea that returns true if the mouse pointer is within an area in which we are allowed to drop and false otherwise:</p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// checks if drop is allowed</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// at the current location of the</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// mouse pointer.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0000ff;font-family:&#34;">bool </span><span style="font-size:10pt;font-family:&#34;">InAllowedArea(<span style="color:#2b91af;">MouseEventArgs</span> e)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#2b91af;">Point </span>p = e.GetPosition(<span style="color:#0000ff;">null</span>);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#2b91af;">IEnumerable</span>&#60;<span style="color:#2b91af;">UIElement</span>&#62; hitTestResult = </span></p>
<p class="MsoNormal" style="text-indent:.5in;margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>  </span>AllowedArea.HitTest(p);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// see if mouse pointer hits AllowedArea</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// if yes, return true,</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// if no, return false.</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#0000ff;">return</span>(hitTestResult.Count() != 0);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">}</span></p>
<p>Then, during the Drag process, we check if we are within the area in which we are allowed to drop and set the ContentTemplate of the PopupControl correspondingly:</p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0000ff;font-family:&#34;">if</span><span style="font-size:10pt;font-family:&#34;">(InAllowedArea(e))</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// if we are in an area</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// in which we are</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// allowed to drop</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// set the template accordingly</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// to our Circle</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>PopupControl.ContentTemplate = CircleTemplate;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0000ff;font-family:&#34;">else</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// if we are in an area in which it</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#008000;">// is forbidden to drop, set</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>PopupControl.ContentTemplate = DropForbidden;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">}</span></p>
<p class="MsoNormal" style="margin:0;"> </p>
<h2>Generic Drag and Drop Control</h2>
<p>Based on the above examples and also taking into account that the Drag popup display can be data driven (as will be shown later) I came up with a generic Drag/Drop control implementation. While it is still rather complex to use, since drag and drop is a complex operation, it also absorbs a lot of complexity into itself, eliminating the need to implement and debug a large chunk of the Drag/Drop functionality over and over again.</p>
<p>Here is the code for generic Drag/Drop control together with a couple of samples showing how to use it: <a href="http://nickssoftwareblog.files.wordpress.com/2008/10/genericdragdropzip.doc">genericdragdropzip.doc</a>.</p>
<p>DragDrop control is defined within GenericDragDropLib project within DragDropControl.cs file. The generic.xaml file contains default control template for DragDropControl.<br />
DragDropControl contains a number of properties and events that allow customization of the Drag/Drop functionality. Here is the list of these properties and events with the explanations as to why they are needed.</p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// mouse is captured and the popup </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// indicating the beginning of Drag</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// operation to the user becomes</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// visible on when the distance between</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// the mouse pointer and the original </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// point when the mouse button was pressed</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// during the Drag operation is </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// greater than CaptureRadius.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0000ff;font-family:&#34;">public</span><span style="font-size:10pt;font-family:&#34;"> <span style="color:#0000ff;">double</span>CaptureRadius { <span style="color:#0000ff;">get</span>; <span style="color:#0000ff;">set</span>; }</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// the popup to show during Drag operation</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0000ff;font-family:&#34;">public</span><span style="font-size:10pt;font-family:&#34;"> <span style="color:#2b91af;">Popup</span> DragDropPopup { <span style="color:#0000ff;">get</span>; <span style="color:#0000ff;">set</span>; }</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// The content control within the DragDropPopup</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// that can assume any shape defined by </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// its data template and date content. </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0000ff;font-family:&#34;">public</span><span style="font-size:10pt;font-family:&#34;"> <span style="color:#2b91af;">ContentControl</span> PopupContentControl { <span style="color:#0000ff;">get</span>; <span style="color:#0000ff;">set</span>; }</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// default data template for areas in </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// which drop is allowed</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0000ff;font-family:&#34;">public</span><span style="font-size:10pt;font-family:&#34;"> <span style="color:#2b91af;">DataTemplate</span> DropAllowedTemplate { <span style="color:#0000ff;">get</span>; <span style="color:#0000ff;">set</span>; }</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// data template for areas in which</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// drop is forbidden</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0000ff;font-family:&#34;">public</span><span style="font-size:10pt;font-family:&#34;"> <span style="color:#2b91af;">DataTemplate</span> DropForbiddenTemplate { <span style="color:#0000ff;">get</span>; <span style="color:#0000ff;">set</span>; }</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// element to be dragged</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0000ff;font-family:&#34;">public</span><span style="font-size:10pt;font-family:&#34;"> <span style="color:#2b91af;">UIElement</span>DraggedElement { <span style="color:#0000ff;">get</span>; <span style="color:#0000ff;">set</span>; }</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// dragged business logic object</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// (specified by Content property of DraggedElement)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0000ff;font-family:&#34;">public</span><span style="font-size:10pt;font-family:&#34;"> <span style="color:#0000ff;">object</span>DraggedObject { <span style="color:#0000ff;">get</span>; <span style="color:#0000ff;">set</span>; }</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// DragContainer property is used when DraggedElement is</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// one of the items within and ItemsControl e.g. a</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// ListBox this property contains the reference to this </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// container control of the dragged item</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0000ff;font-family:&#34;">public</span><span style="font-size:10pt;font-family:&#34;"> <span style="color:#2b91af;">UIElement</span>DragContainer {<span style="color:#0000ff;">get</span>; <span style="color:#0000ff;">set</span>;}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// does the drop operation</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0000ff;font-family:&#34;">public</span><span style="font-size:10pt;font-family:&#34;"> <span style="color:#0000ff;">event</span> <span style="color:#2b91af;">DoDropDelegate</span>DoDrop = <span style="color:#0000ff;">null</span>;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// used to filter in the element that can be</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// dragged</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0000ff;font-family:&#34;">public</span><span style="font-size:10pt;font-family:&#34;"> <span style="color:#0000ff;">event</span> <span style="color:#2b91af;">IsDraggableDelegate</span>IsDraggable = <span style="color:#0000ff;">null</span>;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// used to filter in the container of the element</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// that can be dragged</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0000ff;font-family:&#34;">public</span><span style="font-size:10pt;font-family:&#34;"> <span style="color:#0000ff;">event</span> <span style="color:#2b91af;">IsContainerDelegate</span> IsDragContainer = <span style="color:#0000ff;">null</span>;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// returns true if, during the drag operation,</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// the mouse pointer is inside the area </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// it which drops are allowed, false otherwise.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0000ff;font-family:&#34;">public</span><span style="font-size:10pt;font-family:&#34;"> <span style="color:#0000ff;">event</span> <span style="color:#2b91af;">IsInAllowedAreaDelegate</span>IsInAllowedArea = <span style="color:#0000ff;">null</span>;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// returns data template for the case when the drops are</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// allowed during the drag operation</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0000ff;font-family:&#34;">public</span><span style="font-size:10pt;font-family:&#34;"> <span style="color:#0000ff;">event</span> <span style="color:#2b91af;">GetDataTemplateDelegate</span> GetDataTemplate = <span style="color:#0000ff;">null</span>;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">//used to set the DraggedObject from the </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// DraggedElement. </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// Most of the times, this is just DraggedElement.Content</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0000ff;font-family:&#34;">public</span><span style="font-size:10pt;font-family:&#34;"> <span style="color:#0000ff;">event</span> <span style="color:#2b91af;">GetBusinessLogicObjectDelegate</span> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>GetBusinessLogicObject = <span style="color:#0000ff;">null</span>;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// used to record the origin of the drag operation</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0000ff;font-family:&#34;">public</span><span style="font-size:10pt;font-family:&#34;"> <span style="color:#2b91af;">Point</span> StartDragPoint { <span style="color:#0000ff;">get</span>; <span style="color:#0000ff;">set</span>; }</span></p>
<p>DragDropControl also contains three functions that need to be triggered by the Button Down, Mouse Move and Button Up events of the application that uses DragDropControl. These functions are</p>
<li>StartDragDrop</li>
<li>OnMove</li>
<li>OnButtonUp</li>
<p>Below we describe two examples using DragDropControl.</p>
<h3>Drag Drop with Forbidden Area Implemented Using DragDropControl</h3>
<p>The solution for this test is called GenericDragDropTest.sln and it is located under GenericDragDropTest within genericdragdrop.zip file. It produces exactly the same result as our Drag/Drop with forbidden area example above, but it uses DragDropControl. Below we show how DragDropControl is used.<br />
Here is the code showing how we connect the events of DragDropControl:</p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">MyDragDropControl.DoDrop += </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#0000ff;">new</span> GenericDragDropLib.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>        </span><span style="color:#2b91af;">DoDropDelegate</span>(MyDragDropControl_DoDrop);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// we only drag ellipses!</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">MyDragDropControl.IsDraggable +=</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#0000ff;">delegate</span>(<span style="color:#2b91af;">UIElement</span> element)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>        </span><span style="color:#0000ff;">if</span> (element <span style="color:#0000ff;">is</span> <span style="color:#2b91af;">Ellipse</span>)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>            </span><span style="color:#0000ff;">return</span> <span style="color:#0000ff;">true</span>;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>        </span><span style="color:#0000ff;">return</span> <span style="color:#0000ff;">false</span>;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>};</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// data template for the drag popup is</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// provided by CircleTemplate resource</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">MyDragDropControl.GetDataTemplate +=</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#0000ff;">delegate</span>(<span style="color:#2b91af;">UIElement</span> element)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>        </span><span style="color:#0000ff;">return</span> (<span style="color:#2b91af;">DataTemplate</span>) <span style="color:#0000ff;">this</span>.Resources[<span style="color:#a31515;">"CircleTemplate"</span>];</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>};</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// we are in an area in which are</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// are allowed to drop if the </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// mouse pointer is</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// inside AllowedArea circle.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">MyDragDropControl.IsInAllowedArea += </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#0000ff;">delegate</span>(<span style="color:#2b91af;">Point</span> p)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>        </span><span style="color:#2b91af;">IEnumerable</span>&#60;<span style="color:#2b91af;">UIElement</span>&#62; hitTestResult = </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>            </span>AllowedArea.HitTest(p);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>        </span><span style="color:#0000ff;">return</span>(hitTestResult.Count() != 0);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>};</span></p>
<p>And here is the code that connects the mouse button events to the DragDropControl functions:</p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// connect the mouse button events to</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// the corresponding functions </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// of our DragDropControl.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">LayoutRoot.MouseLeftButtonDown +=</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#0000ff;">delegate</span>(<span style="color:#0000ff;">object</span> sender, <span style="color:#2b91af;">MouseButtonEventArgs</span> e)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>        </span>MyDragDropControl.StartDragDrop(<span style="color:#0000ff;">this</span>, e);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>};</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">LayoutRoot.MouseMove +=</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#0000ff;">delegate</span>(<span style="color:#0000ff;">object</span> sender, <span style="color:#2b91af;">MouseEventArgs</span> e)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>        </span>MyDragDropControl.OnMove(e);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>};</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">LayoutRoot.MouseLeftButtonUp +=</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#0000ff;">delegate</span>(<span style="color:#0000ff;">object</span> sender, <span style="color:#2b91af;">MouseButtonEventArgs</span> e)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>   </span><span> </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>        </span>MyDragDropControl.OnButtonUp(e);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>};</span></p>
<h3>Drag and Drop between Two ListBox Elements</h3>
<p>Here we show an implementation of Drag/Drop analogous to that of <a href="http://leeontech.wordpress.com/2008/04/11/drag-and-drop-in-silverlight/">Drag and Drop in Silverlight</a>. The ListBoxItem objects are dragged and dropped between two ListBoxes.</p>
<p>The code for this sample can be found under ListBoxDragDropTest directory of genericdragdrop.zip file.<br />
Here is the screen capture for this sample:</p>
<p style="text-align:center;"><a href="http://nickssoftwareblog.files.wordpress.com/2008/10/listboxdragdrop.jpg"><img class="aligncenter size-full wp-image-381" title="listboxdragdrop" src="http://nickssoftwareblog.wordpress.com/files/2008/10/listboxdragdrop.jpg" alt="" width="435" height="501" /></a></p>
<p>This sample also provides an example of having data driven visual presentation of the dragged item (the first and last names of the students provide the data that can change depending on the dragged item).<br />
Here is the code showing setting the event handlers for DragDropControl events:</p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">MyDragDropControl.DoDrop +=</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#0000ff;">new</span> GenericDragDropLib.<span style="color:#2b91af;">DoDropDelegate</span>(DoDrop);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// we only Drag and Drop ListBoxItem objects!</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">MyDragDropControl.IsDraggable +=</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#0000ff;">delegate</span>(<span style="color:#2b91af;">UIElement</span> element)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>        </span><span style="color:#0000ff;">if</span> (element <span style="color:#0000ff;">is</span> <span style="color:#2b91af;">ListBoxItem</span>)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>            </span><span style="color:#0000ff;">return</span> <span style="color:#0000ff;">true</span>;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>        </span><span style="color:#0000ff;">return</span> <span style="color:#0000ff;">false</span>;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>};</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// our drag container is ListBox</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">MyDragDropControl.IsDragContainer +=</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#0000ff;">delegate</span>(<span style="color:#2b91af;">UIElement</span> element)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>        </span><span style="color:#0000ff;">if</span> (element <span style="color:#0000ff;">is</span> <span style="color:#2b91af;">ListBox</span>)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>            </span><span style="color:#0000ff;">return</span> <span style="color:#0000ff;">true</span>;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>        </span><span style="color:#0000ff;">return</span> <span style="color:#0000ff;">false</span>;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>};</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// we use the same DataTemplate</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// to display the drag popup as</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// we use to display the items in the list</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">MyDragDropControl.GetDataTemplate +=</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#0000ff;">delegate</span>(<span style="color:#2b91af;">UIElement</span> element)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>        </span><span style="color:#2b91af;">ListBoxItem</span>lbi = MyDragDropControl.DraggedElement <span style="color:#0000ff;">as</span> <span style="color:#2b91af;">ListBoxItem</span>;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>        </span><span style="color:#0000ff;">if</span>(lbi == <span style="color:#0000ff;">null</span>)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>            </span><span style="color:#0000ff;">return</span> <span style="color:#0000ff;">null</span>;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>        </span><span style="color:#0000ff;">return</span> (<span style="color:#2b91af;">DataTemplate</span>)lbi.ContentTemplate;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>};</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// we are in allowed area if and only if we are </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// inside a ListBox</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">MyDragDropControl.IsInAllowedArea +=</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#0000ff;">delegate</span>(<span style="color:#2b91af;">Point</span> p)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>        </span><span style="color:#2b91af;">ListBox</span>lb = GetListBox(p);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>        </span><span style="color:#0000ff;">if</span> (lb == <span style="color:#0000ff;">null</span>)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>            </span><span style="color:#0000ff;">return</span> <span style="color:#0000ff;">false</span>;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>        </span><span style="color:#0000ff;">return</span> <span style="color:#0000ff;">true</span>;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>};</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#008000;font-family:&#34;">// returns Content property of the ListBoxItem</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">MyDragDropControl.GetBusinessLogicObject +=</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span><span style="color:#0000ff;">delegate</span>(<span style="color:#2b91af;">UIElement</span> element)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>        </span><span style="color:#2b91af;">ContentControl</span> cc = element <span style="color:#0000ff;">as</span> <span style="color:#2b91af;">ContentControl</span>;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>        </span><span style="color:#0000ff;">if</span> (cc == <span style="color:#0000ff;">null</span>)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>            </span><span style="color:#0000ff;">return</span> <span style="color:#0000ff;">null</span>;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>        </span><span style="color:#0000ff;">return</span> cc.Content;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span>    </span>};</span></p>
<p>One can see that the DoDrop function (called during the drop operation) checks if the target ListBox is not the same as the original ListBox from where the item was dragged and if true, removes the item from the original collection and adds it to the collection of the target ListBox.</p>
<h2>Conclusion</h2>
<p style="text-align:left;">This article describes the implementation of drag and drop functionality in Silverlight. It starts with a simple example and progresses to more complex ones. It features custom DragDropControl which is used to absorb a lot of complexity of Drag/Drop implementation.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[DAZ 3D, GoFigure Animation Plug-in ]]></title>
<link>http://mytechbox.wordpress.com/?p=1116</link>
<pubDate>Sat, 04 Oct 2008 08:29:05 +0000</pubDate>
<dc:creator>Rakesh Raman</dc:creator>
<guid>http://mytechbox.wordpress.com/2008/10/04/daz-3d-gofigure-animation-plug-in/</guid>
<description><![CDATA[DAZ 3D, GoFigure Offer Drag-and-Drop Animation Plug-in 
Christened aniMate, it’s created by GoFigu]]></description>
<content:encoded><![CDATA[<p><a href="http://mytechboxonline.com/fun/fun-daz-1008.html" target="_blank"><strong>DAZ 3D, GoFigure Offer Drag-and-Drop Animation Plug-in</strong> </a><br />
Christened aniMate, it’s created by GoFigure, a producer of viral applications for Internet, computer, and mobile social networks; and DAZ 3D, which develops 3D software and models. The aniMate tool aims to simplify the job of animation artists by providing ready-to-use building blocks. The DAZ Studio users can animate 3D characters through drag-and-drop modules…<strong><a href="http://mytechboxonline.com/fun/fun-daz-1008.html" target="_blank">Full Article</a></strong></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Debunking the "can't be optimized" myth]]></title>
<link>http://homesteadwebsitedesign.wordpress.com/?p=59</link>
<pubDate>Wed, 17 Sep 2008 16:42:50 +0000</pubDate>
<dc:creator>sjhwd</dc:creator>
<guid>http://homesteadwebsitedesign.wordpress.com/2008/09/17/debunking-the-cant-be-optimized-myth/</guid>
<description><![CDATA[The Homestead SiteBuilder program often receives negative remarks from coding purists and those ill-]]></description>
<content:encoded><![CDATA[<p>The Homestead SiteBuilder program often receives negative remarks from coding purists and those ill-informed of the benefits of the website designing software. Bring up the topic of Homestead in a Forum such as the Google Group and you immediately have snide comments.</p>
<p>Far too many web designers who hand code, utilize templates or even software programs such as Dreamweaver tend to look down on Homestead’s drag and drop type of program. They look at the site’s code and spout things such as “couldn't produce a well optimized site if it tried.” Granted, Homestead’s code is not the prettiest, but it can certainly hold its own with websites developed using the methods mentioned above. And, as time goes by Homestead will almost certainly improve upon the coding structure of the software. There are many, many Homestead users who have websites that outrank sites developed by web designers who used the so-called conventional methods. </p>
<p>The average user can create an attractive, user friendly site that is well optimized using Homestead’s SiteBuilder program. Any website, regardless of the method used to build it, will suffer if the webmaster doesn’t also have a working knowledge of usability and search engine optimization. The site can also suffer if the designer doesn’t fully understand the program they use.</p>
<p><em>Those of us who utilize the Homestead Site Builder and have a working knowledge of website usability and search engine optimization understand the short comings of the SiteBuilder program. We have learned how to work with the program and work around the problems that are intrinsic in using a WYSIWYG or drag and drop site builder software.</em><br />
 <br />
It is important to learn and understand certain potential road blocks presented by portions of the SiteBuilder program and adjust accordingly to bypass these issues. Items such as Java Script navigation and some of the templates that rely heavily on java-script can be problematic. The Apply-to-All feature for Meta tags, while seemingly a time saver, should never be used. Using the full SiteBuilder program rather than SiteBuilder Lite offers more options for creating a user friendly, well optimized site. Making use of the <a title="Homestead Connection Forum" href="http://www.readybb.com/homesteadconnection" target="_blank"><strong>Homestead Connection Forum</strong></a>, the <a title="Homestead Connection" href="http://www.homesteadconnection.com" target="_blank"><strong>Homestead Connection Site</strong></a>, and even this Blog will help users of the program learn the do’s and don’ts associated with it.</p>
<p>Designing a site that will succeed is not so much dependent upon the method the site is built with as it is having a basic understanding of Search Engines requirements and usability standards. Every search engine uses different algorithms and knowing the basic requirements of those engines aids in producing an acceptable website. This applies to usability as well. Knowing what is user friendly helps to design a site that visitors will find appealing.</p>
<p>Homestead websites can be optimized to do as well in search rankings as any website regardless of who built it or how it was built. But, sites built with Homestead have something most others don’t and that is the ability for the site owner to either build their own website or to easily take it over once the site is designed. This is not the case with the vast majority of web sites that have been created by design companies. In most instances the owner ends up with a website that they can’t update or make even simple changes to. They have to continue to pay someone for updates, and SEO and link building.</p>
<p>It is no wonder that many web designers and those who are ill-informed or biased take the stance that Homestead sites are lacking…. if everyone were to find out that they are a viable option that can save the site owner time and money and do well in searches, we would see even more people taking the Homestead route.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Air Sharing iPhone App]]></title>
<link>http://nicelake.wordpress.com/?p=172</link>
<pubDate>Sun, 14 Sep 2008 16:17:11 +0000</pubDate>
<dc:creator>nicelake</dc:creator>
<guid>http://nicelake.wordpress.com/2008/09/14/air-sharing-iphone-app/</guid>
<description><![CDATA[There is a great free app in the iTunes App Store called Air Sharing.  This app allows you to mount]]></description>
<content:encoded><![CDATA[<p>There is a great free app in the iTunes App Store called <a title="Air Sharing" href="http://www.avatron.com/products/" target="_blank">Air Sharing</a>.  This app allows you to mount your iPhone / iPod Touch as a wireless drive on your Mac,Windows or Linux computer and drag and drop files with ease.</p>
<p>This is a great way to transfer your files.  Air Sharing will allow you to view  documents in common formats.  I loaded some PDF,MS Word,Xcel,JPG files and they opened just fine.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[The password storing and filling problem]]></title>
<link>http://amolpatil2k.wordpress.com/?p=34</link>
<pubDate>Fri, 05 Sep 2008 08:59:42 +0000</pubDate>
<dc:creator>amolpatil2k</dc:creator>
<guid>http://amolpatil2k.wordpress.com/2008/09/05/the-password-storing-and-filling-problem/</guid>
<description><![CDATA[We all need to store and fill passwords almost everyday. There are many approaches to this problem. ]]></description>
<content:encoded><![CDATA[<p>We all need to store and fill passwords almost everyday. There are many approaches to this problem. True to form, Mashable put out a megapost with over 60 tools to help us out in this area.</p>
<h3><strong>60+ Free Password Managers and Form Fillers</strong></h3>
<p><a href="http://mashable.com/2007/09/17/password-managers/"></a></p>
<p><a href="http://mashable.com/2007/09/17/password-managers/">http://mashable.com/2007/09/17/password-managers/</a></p>
<p>I tried some of these. In my opinion, the following ones are worth trying.<br />
<!--more Click here to read rest of the post--></p>
<h4><strong>Password Managers (Online)</strong></h4>
<p><strong>PassPack</strong></p>
<p><a href="http://www.passpack.com/">http://www.passpack.com/</a></p>
<p>This is an online and offline password generator and manager with many features like 1-click logins, Anti-Phishing, Rapid Sign In, disposable logins, import and export, etc.</p>
<h4><strong>Password Managers (Desktop applications)</strong></h4>
<p><strong>Absolute Privacy</strong></p>
<p><a href="http://www.cryptobase.com/">http://www.cryptobase.com/</a></p>
<p>Stores your contacts, calendar, task list, diary, memos, passwords, and financial information.</p>
<p><strong>Access Manager</strong></p>
<p><a href="http://www.accessmanager.co.uk/">http://www.accessmanager.co.uk/</a></p>
<p>Drag and drop passwords from user list to websites.</p>
<p><strong>Keepass Password Safe</strong></p>
<p><a href="http://keepass.info/">http://keepass.info/</a></p>
<p>Open source application to store all your passwords in a encrypted form.</p>
<p><strong>Era Password Manager</strong></p>
<p><a href="http://www.dheone.com/">http://www.dheone.com/</a></p>
<p>Install the Era Password Manager on your USB drive and carry your passwords securely.</p>
<p><strong>Scarabay</strong></p>
<p><a href="http://www.alnichas.info/">http://www.alnichas.info/</a></p>
<p>Password manager application from where you can drag and drop your login information.</p>
<h4><strong>Form fillers / Browser Add-ons</strong></h4>
<p><strong>inFormEnter</strong></p>
<p><a href="http://ife.elza.ru/">http://ife.elza.ru/</a></p>
<p>A nice Firefox extension that puts image markers beside input fields on websites which can be selected for auto filling forms.</p>
<p><strong>Roboform</strong></p>
<p><a href="http://www.roboform.com/">http://www.roboform.com/</a></p>
<p>Browser toolbar that helps automate online form filling and logins. You can only store ten passwords in its free edition though.</p>
<p>There are some <strong>Miscellaneous password tools</strong> but I didn't try any of these.</p>
<h3><strong>The basic requirements for password storing and filling</strong></h3>
<p>Everybody has different requirements. My logic in whittling down the options was based on the following requirements.</p>
<p>(1) <strong>It shouldn't be an online service because of privacy concerns</strong>. Although according to Tara Kelly of PassPack, the passwords are encrypted in the browser itself before being stored at their server.</p>
<p><a href="http://mashable.com/2007/09/17/password-managers/">Tara Kelly (PassPack)</a><br />
2008-06-15 03:43:19</p>
<p>Denny, the nice part about Host-Proof Hosting is that it runs using Javascript in the browser.</p>
<p>If you want to watch what is getting sent back and forth to the server, you can trace the Javascript in action. Tools like Firebug do this very well.</p>
<p>Also, since it's javascript, you can simply download the .js files and have a look if you'd like. Passpack optimizes the files to be faster online, but you can use the depacker here: http://www.passpack.com/info/thanks/</p>
<p>You're welcome to study the code. We don't release it as open source because we don't want copy-cat products popping up, that's all.</p>
<p>(2) <strong>It shouldn't be browser based.</strong> This is because I may choose to use IE, Firefox 2 Portable or Firefox 3 Portable based on  the extensions I need.</p>
<p>(3) <strong>It shouldn't be a gigantic application</strong> installing lots of stuff on my PC.</p>
<p>(4) <strong>It should ideally be portable</strong> so it can be taken along with the portable browsers.</p>
<p>(5) <strong>It should offer drag and drop.</strong> And should be able to automatically distinguish between dragging to browser (clipboard) and dragging to email client (keystrokes). Most apps in this list offer just "copy to clipboard" which is too slow and awkward. On the other hand, apps that offer auto filling are too fast and you need to trust the app to recognise the fields. Having said that, one must say that if one needs to fill in complicated forms on an almost daily basis, then these are a boon. Since I just need to fill in simple login forms, for me auto fill is a somewhat overkill.</p>
<p>(6) <strong>It needs to have a tree structure</strong> to organise data.</p>
<p>I finally settled for <strong>Filler</strong> and <strong>Scarabay</strong>. If you find <strong>Access Manager</strong>, <strong>KeePass</strong> or <strong>Era password Manager</strong> better, please let me know. I must admit I didn't test these as thoroughly as I should have.</p>
<h3><strong>Paul Scott's Filler is the simplest solution</strong></h3>
<p><a href="http://www3.sympatico.ca/paulscott/filler.htm"></a></p>
<p><a href="http://www3.sympatico.ca/paulscott/filler.htm">http://www3.sympatico.ca/paulscott/filler.htm</a></p>
<p>If you don't care about security and if all your password data can fit in a text file of 5 KB, then use Filler. Filler is not mentioned in the Mashable list. And I am sure that there are other fillers like this. As of now, this is all I could find. If you find something along these lines, do let me know. Apart from the measly 5 KB limit, another problem with Filler is that you have to go into options everytime you need to drag to a email client instead of browser.</p>
<p><img src="http://amolpatil2k.wordpress.com/files/2008/09/paul_scott_filler_drag_n_drop.png" border="0" alt="Paul_Scott_Filler_Drag_n_Drop.png" /></p>
<p>Just Drag n Drop the URL. Once the page loads, drag and drop the login name and password.</p>
<p><img src="http://amolpatil2k.wordpress.com/files/2008/09/paul_scott_filler_options.png" border="0" alt="Paul_Scott_Filler_Options.png" /></p>
<p>To switch between dragging to Browser and dragging to Email Client, one needs to go into Options.</p>
<h3><strong>Nick Kalmykov's SCARABAY is the best solution</strong></h3>
<p><a href="http://www.alnichas.info/">http://www.alnichas.info/</a></p>
<p>In my opinion, SCARABAY is the overall winner. It is not online. It is not browser based. It is a simple app (1.8 MB download, 2.8 MB installed). It is not portable (sigh!). It offers drag n drop to both email client and browser and also has auto fill. It provides a tree structure.</p>
<p><img src="http://amolpatil2k.wordpress.com/files/2008/09/scarabay_login.png" border="0" alt="SCARABAY_Login.png" /></p>
<p><strong>SCARABAY Login Screen:</strong> Create a profile by providing a name and password. This secures your passwords from other users.</p>
<p><img src="http://amolpatil2k.wordpress.com/files/2008/09/scarabay_initial_folders.png" border="0" alt="SCARABAY_Initial_Folders.png" /></p>
<p><strong>SCARABAY</strong> starts with some folders thrown in. <strong>Delete these folders</strong> and create your own.</p>
<p><img src="http://amolpatil2k.wordpress.com/files/2008/09/scarabay_create_folder.png" border="0" alt="SCARABAY_Create_Folder.png" /></p>
<p><strong>SCARABAY Create Folder</strong> is the third button in the footer.</p>
<p><img src="http://amolpatil2k.wordpress.com/files/2008/09/scarabay_add_entry.png" border="0" alt="SCARABAY_Add_Entry.png" /></p>
<p><strong>SCARABAY Add New</strong> button would add an entry to the folder we created.</p>
<p><img src="http://amolpatil2k.wordpress.com/files/2008/09/scarabay_edit_login.png" border="0" alt="SCARABAY_Edit_Login.png" /></p>
<p><strong>SCARABAY Add New</strong> and <strong>Edit</strong> buttons let us add and edit the various entries.</p>
<p><img src="http://amolpatil2k.wordpress.com/files/2008/09/scarabay_edit_email.png" border="0" alt="SCARABAY_Edit_Email.png" /></p>
<p><strong>SCARABAY Email Field</strong> is useful if you need to supply your email address. You can also create a contacts list.</p>
<p><img src="http://amolpatil2k.wordpress.com/files/2008/09/scarabay_tree_structure.png" border="0" alt="SCARABAY_Tree_Structure.png" /></p>
<p><strong>SCARABAY Tree Structure</strong> allows you to neatly organise all your passwords.</p>
<p><img src="http://amolpatil2k.wordpress.com/files/2008/09/scarabay_configure_browser.png" border="0" alt="SCARABAY_Configure_Browser.png" /></p>
<p><strong>SCARABAY</strong> automatically integrates in installed browsers. If you use portable browsers as I do, then you need to <strong>specify their location</strong>.</p>
<p><img src="http://amolpatil2k.wordpress.com/files/2008/09/scarabay_configure_backups.png" border="0" alt="SCARABAY_Configure_Backups.png" /></p>
<p><strong>SCARABAY</strong> can mirror the password file of your account to a <strong>backup location</strong> on either the same drive or on a USB drive. The problem is that because it does not <strong>timestamp the backups</strong>, as in scdata_20080905135023.pwd, the newer backup file will overwrite the older one leaving no room for rollbacks. If you want to be extra sure, you must timestamp the backups manually.</p>
<p><img src="http://amolpatil2k.wordpress.com/files/2008/09/scarabay_drag_n_drop.png" border="0" alt="SCARABAY_Drag_n_Drop.png" /></p>
<p><strong>SCARABAY Webpage (Drag-and-Drop)</strong> is the killer feature. Drag n Drop the <strong>globe</strong> into the browser to load the URL, then drag and drop the <strong>login name</strong> and <strong>password</strong> into the respective fields.</p>
<p>Some other features are the ability to <strong>Generate Passwords</strong>, the ability to fetch data from <strong>Past URLs</strong> and the ability to <strong>Change the Icons</strong> associated with any folder or entry. For instance, you can change the white icon for entries to some red colored one if you think that Entry needs to be checked on a daily basis.</p>
<h3><strong>Some Problems I noticed in SCARABAY</strong></h3>
<ol>
<li>There is no <strong>export facility</strong>, the most crucial feature. This means either you agree to get locked into this application and its upgrades, or you don't store too much data in it.</li>
<li>The <strong>scrolling behavior</strong> is very wonky. The work around has been described above.</li>
<li>It does not timestamp the <strong>Backups</strong>.</li>
<li>There are only two skins. They should've included a <strong>No Skin option</strong> (Windows default). Luckily, they do have a <strong>saturation</strong> feature in <strong>Options</strong> which allows us to desaturate it to zero like I have done here.</li>
<li>The <strong>Open Web Page</strong> functionality starts a new browser window. There should have been an option to load the new page in the <strong>current window</strong>. Although this functionality is available using the <strong>"globe" drag and drop</strong>. In fact I would have liked if the <strong>entries could directly be dragged and dropped</strong> instead of click on entry then drag the "globe".</li>
<li>The drag and drop mouse cursor resembles the pair of gloves worn by <strong>Mickey Mouse</strong>.</li>
<li>The <strong>Automatic Filling</strong> feature works only in IE. If Firefox is installed, will it work in that, too. I don't have Firefox installed (shoot!). Can anyone confirm this?</li>
<li>The <strong>scrolling behavior</strong> is a bit wonky. For instance, we can be in the middle of the tree, but the scroll bar would show that it has reached the end. I got around this by clicking on the collapse all (so called <strong>Curtail All</strong>), expand all (so called <strong>Develop All</strong>) buttons. Sometimes things get so bad that one has to log off (<strong>File &#62; Change User</strong>) and then log back in.</li>
<li>The <strong>Magnifying Glass</strong> functionality is on only till the mouse click is released. Ideally it should have had a toggle behavior. Click on <strong>Magnifying Glass</strong> and it stays depressed and shows details of the entries we click on. Then click again and is stop showing the details.</li>
<li>When you right click to <strong>Change the Name</strong> of a folder or entry, you are presented with a blank field. Ideally it should allow in place editing much like when we rename (F2) a filename in Windows Explorer.</li>
</ol>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Miniaturowy dysk Freecoma]]></title>
<link>http://xteam7.wordpress.com/?p=1430</link>
<pubDate>Fri, 05 Sep 2008 07:55:21 +0000</pubDate>
<dc:creator>ParalyserX</dc:creator>
<guid>http://xteam7.wordpress.com/2008/09/05/miniaturowy-dysk-freecoma/</guid>
<description><![CDATA[
Najmniejszy i najlżejszy  2,5-calowy zewnętrzny dysk twardy - Freecom Mobile Drive XXS
Freecom, z]]></description>
<content:encoded><![CDATA[<p align="center">
<p align="center"><a href="http://xteam7.files.wordpress.com/2008/09/mobile-drive-xxs-in-hand.jpg"><img class="alignleft size-medium wp-image-1435" title="mobile-drive-xxs-in-hand" src="http://xteam7.wordpress.com/files/2008/09/mobile-drive-xxs-in-hand.jpg?w=300" alt="" width="300" height="188" /></a><em>Najmniejszy i najlżejszy  2,5-calowy zewnętrzny dysk twardy - Freecom Mobile Drive XXS</em></p>
<p align="justify">Freecom, za pośrednictwem dystrybutora Veracomp,  zaoferował najmniejszy i najlżejszy spośród dostępnych na rynku  2,5-calowy zewnętrzny dysk twardy - Freecom Mobile Drive XXS. Dysk  jest dostępny w Polsce w pojemności do 320 GB i kosztuje już od 284  zł brutto.</p>
<p align="justify">Miniaturowy Freecom Mobile  Drive XXS jest mniejszy od paszportu (109,8 x 79,5 x 13,5 mm) i lżejszy  od niejednego telefonu komórkowego (155 g). Oferuje szybkość transmisji  danych 480 Mbit/sek. gwarantując jednocześnie cichą pracę (brak  wentylatora). Dostępny jest w wersjach z pojemnością 160GB, 250GB  i 320GB, w cenie od 284 zł brutto za model o najmniejszej pojemności.</p>
<p align="justify">Oprócz kompaktowych  rozmiarów, dysk jest prosty w obsłudze, umożliwiając backup danych  w technologii „przeciągnij i upuść” („drag and drop”). Urządzenie  jest zasilane bezpośrednio przez USB (bus powered) i tym samym dołączanym  osobno kablem USB 2.0 (jest kompatybilny także z portem USB 1.1) komunikuje  się z komputerem.<!--more--></p>
<p align="justify">„Nowy przenośny dysk  Freecoma umożliwia przechowanie danych, ich wymianę, ochronę i archiwizację.  Jest wygodnym nośnikiem multimediów i idealnym narzędziem pracy podczas  podróży,” - wylicza zalety nowego dysku Przemysław Romański,  menadżer produktów Freecom w Veracomp SA. „Przeliczając oferowane  przez dysk gigabity na złotówki, urządzenie nie ma konkurencji, w  zbliżonej cenie oferuje nieporównywalnie więcej niż np. popularne  dyski w technologii flash”).</p>
<p align="justify"><strong>Ceny i gwarancja:</strong></p>
<p align="justify">Freecom Mobile Driver  XXS jest objęty w Veraocmp dwuletnią gwarancją. Sugerowana cena detaliczna  Freecom Mobile Drive XXS 160GB wynosi 284 zł brutto, Freecom Mobile  Drive XXS 250GB - 355 zł brutto, a Freecom Mobile Drive XXS 320GB -  439 zł brutto.</p>
<p align="justify"><strong>Specyfikacja:</strong></p>
<ul>
<li>Pojemność: 160GB, 250GB,  320GB</li>
<li>Interfejs: USB 2.0, kompatybilność  z portem USB 1.1</li>
<li>Rodzaj dysku twardego:  2.5”, cicha praca, niski pobór mocy</li>
<li>Prędkość transmisji  danych: do 480 Mbit/s (USB 2.0)</li>
<li>Waga: 155g</li>
<li>Wymiary: 109.8 x 79.5  x 13.5 mm</li>
<li>Środowisko pracy: 10º  C / 35º C (temp. pracy), -20º C / 70º C (temp. składowania danych)</li>
<li>Zasilanie: USB (bus powered),  brak konieczności użycia adaptera</li>
<li>Minimalne wymagania systemowe:</li>
<li>PC: Intel Pentium III  / AMD Duron 900 MHz lub wyżej, 256MB RAM (Vista: 512MB RAM)</li>
<li>lub wyżej, USB 2.0 lub  USB 1.1 port, Windows 2000 / XP / Vista</li>
<li>MAC: PowerPC G3/G4/G5,  Power Book G3/G4 lub Intel Mac, 256MB RAM lub wyżej, USB 2.0 lub USB  1.1 port, Mac OS X v10.3 lub wyżej</li>
</ul>
<p align="justify"><strong>Galeria:</strong></p>
<p align="justify">[gallery]</p>
<p align="justify"><strong>Informacje o Freecom</strong></p>
<p align="justify">Freecom  - producent elektroniki użytkowej oraz multimedialnych rozwiązań  do magazynowania danych -  jest specjalizuje się w profesjonalnych  rozwiązaniach dla mobilnych użytkowników. Oferta Freecom zawiera  zewnętrzne dyski twarde (od 1’’ i 1,8’’ kwintesencji mobilności,  poprzez dyski 2,5’’ oraz stacjonarne 3,5’’), miniaturowe nagrywarki  DVD, profesjonalne oraz unikalne rozwiązania Flash czy wreszcie najnowsze  rozwiązania archiwizacji danych w oparciu o systemy taśmowe. Firma  zatrudnia ponad 200 osób zlokalizowanych w 12 krajach Europy, z centrami  koordynacji w Berlinie oraz Delft, a także centrami rozwoju na Tajwanie  i USA. Więcej pod adresem: <a href="http://www.freecom.com/" target="_blank">www.freecom.com</a>.</p>
<p align="justify"><strong>Informacja o Veracomp  SA</strong></p>
<p>Veracomp jest specjalizowanym  dystrybutorem rozwiązań teleinformatycznych. Skupia się na sześciu  obszarach technologicznych: sieci, telekomunikacja, bezpieczeństwo,  serwery i pamięci masowe, zarządzanie infrastrukturą IT, multimedia  i peryferia. Realizuje strategię dystrybucji z wartością dodaną  (VAD - Value Added Distributor). Oprócz standardowych w dystrybucji  usług logistyki i finansowania, Veracomp prowadzi doradztwo techniczne,  świadczy usługi, udziela konsultacji oraz oferuje pomoc marketingową  i edukacyjną. Spółka działa w 16 krajach Europy Środkowowschodniej.  W 2007 roku przychody Veracomp przekroczyły 255 milionów złotych.  Więcej informacji jest na stronie: <a href="http://www.veracomp.pl/" target="_blank">www.veracomp.pl</a>.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Is Google Chrome all it's cracked up to be?]]></title>
<link>http://techneekle.wordpress.com/?p=3</link>
<pubDate>Wed, 03 Sep 2008 22:40:06 +0000</pubDate>
<dc:creator>Charlotte</dc:creator>
<guid>http://techneekle.wordpress.com/2008/09/03/is-google-chrome-all-its-cracked-up-to-be/</guid>
<description><![CDATA[ The most popular topic over the last two days has been Google Chrome, the brand new BETA web browse]]></description>
<content:encoded><![CDATA[<p><span style="text-decoration:underline;color:#0000ee;"><img class="alignleft" src="http://assets.nydailynews.com/img/2008/09/03/amd_googlechrome.jpg" alt="" width="144" height="134" /></span> The most popular topic over the last two days has been <a href="http://www.google.com/chrome">Google Chrome</a>, the brand new BETA web browser from Google released on the 2nd of September. There is a lot of hype over it on whether it's the first nail in Microsoft's grave but this post is purely for the review of the product itself.</p>
<p><br><br />
Here is a video I took of myself using the browser for those who haven't decided whether or not to test it for themselves:</p>
<p style="text-align:center;"><span style='text-align:center; display: block;'><br />
<object type="application/x-shockwave-flash" width="400" height="300" data="http://www.vimeo.com/moogaloop.swf?clip_id=1660435&amp;server=www.vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=01AAEA"><param name="quality" value="best" /><param name="allowfullscreen" value="true" /><param name="scale" value="showAll" /><param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id=1660435&amp;server=www.vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=01AAEA" /></object><br />
</span></p>
<p>As you can see the browser has a lot of cool features, some new, some that Internet Explorer and Firefox both have. I will cover a few of the main features and write my view on each one.</p>
<ol>
<li><strong>The Address bar.</strong> The address bar (known as the omnibox) may look very usual bit it implements several things at once, it allows you to type in your URL as normal but as you type it shows you your web history (what you've visited before that uses the same characters as you are currently typing in the bar). It allows you to type just words into the bar and you can google search the words, it removes the need to install a google search add on. It also suggests completely new sites that you may like to take a look at.</li>
<p><br></p>
<li><strong>Tabs.</strong> Like both Internet explorer and Firefox, Google Chrome uses tabs so you do not have to keep opening separate windows. Whats cool about these tabs is that you can drag and drop them into other windows! Also, if you have just made Chrome your default browser you can still open a new tab with the famous "CTRL+T" shortcut. If you look at the task manager you will notice several "chrome.exe" processes depending on the amount of tabs that are open, this is to help you keep the rest of your tabs running if one was to fail. I find this very handy.</li>
<p><br></p>
<li><strong>Incognito mode.</strong> Internet Explorer has this but either way its still a handy thing for Chrome to have! If you are using a computer that is used by many other people then you may want to use this, this mode allows no recognition of what you have viewed or searched. So if you are buying a present for someone and you are afraid that when they use the computer next, they'll see your web history and ruin the surprise, then Incognito mode is the special feature for you!</li>
<p><br></p>
<li><strong>Developer tools.</strong> If you click the page button next to the Address bar you will find the developer tools under "Developer". When you usually view sources of pages it opens up a little notepad file, but if you got to Developer &#62; View Source it opens it in a new tab instead of a notepad file. You can also find a javascript console here.</li>
<p><br></p>
<li>
<div><strong>Application shortcuts.</strong> There are many web applications out there that I love such as the Google Reader. Instead of using the browser to locate them you can click the Page button next to the address bar &#62; Create application shortcuts. You can send the application shortcut to your desktop, start menu or quick launch. And when you want to open the application just double click the shortcut.</div>
</li>
</ol>
<p><br></p>
<div>I believe that the five aforementioned Features are the best features that Google Chrome offers. Chrome is a much faster process than Firefox, I myself grew tired of the amount of memory Firefox would take up. Chrome takes up a fair amount, but still a lot less than Firefox. Those who wish to transfer from their browser to Chrome can download Chrome <a href="http://www.google.com/chrome">here</a>. After downloading it, launch Chrome and click the spanner and go to "Import bookmarks &#38; settings" for an easy transfer of your important links.</div>
<p><br></p>
<div>I recommend using Google Chrome even if its just to test it, it is also based upon WebKit so Google decided to <em>make everything Open Source</em> which will allow for lots of developer tools made by ordinary people. The only thing I don't like is that Chrome doesn't have any plug-ins or RSS feeds, however it is BETA so I'm sure it will be done in the future!</div>
<p><br></p>
<div>If you'd like to see the comic google made to introduce its browser, click <a href="http://www.google.com/googlebooks/chrome/" target="_blank">here!</a></div>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Dabbling with Drag and Drop in Adobe AIR with Flex 3]]></title>
<link>http://goldenpebbles.wordpress.com/?p=84</link>
<pubDate>Wed, 03 Sep 2008 11:25:04 +0000</pubDate>
<dc:creator>alanbuxton</dc:creator>
<guid>http://goldenpebbles.com/2008/09/03/dabbling-with-drag-and-drop-in-adobe-air-with-flex-3/</guid>
<description><![CDATA[One of the fun things about my job is checking out where we can use new technologies to enhance our ]]></description>
<content:encoded><![CDATA[<p>One of the fun things about my job is checking out where we can use new technologies to enhance our service offering. I’m a doubting Thomas when it comes to new technologies. I don’t like to rely on third party sources (whether blatant marketing, analyst reports or even developers excited about a new tool). I need to have a go myself. </p>
<p>I've been keeping tabs on the development of Adobe AIR over the past months. Readers of this blog will know that I’m an <a href="http://goldenpebbles.com/2008/08/20/careful-with-all-that-flash-flex-and-air/">ardent believer that the user experience needs to be got right first</a>, and only then should be enhanced with something whizzy. But for sure we all want to have a range of whizzy tools available to us to use judiciously.</p>
<p>So I thought I’d have a look at how easy it is with Adobe AIR to do some drag and drop.</p>
<p>A few points before I start. You can develop AIR applications in a number of languages, e.g. Flex or HTML/JS. The documentation isn’t all that clear but from what I can figure so far:</p>
<ul>
<li>If you use HTML/JS then you are limited to the usual drag and drop of items within a web page. But you can’t drag to/from the desktop</li>
<li>If you want to be able to drag items to/from the desktop you need to use something like Flex.</li>
<li>Flex apparently also supports limited dragging of certain items from the application to the desktop. From what I can figure in practice this means dragging a data table into a spreadsheet.</li>
</ul>
<p>So I’m using Flex in this example. There is some sample code out there (e.g. <a href="http://www.mikechambers.com/blog/2007/11/07/air-example-native-drag-and-drop/">http://www.mikechambers.com/blog/2007/11/07/air-example-native-drag-and-drop/</a>) but when I checked it out it hadn’t been updated for Flex 3. The example below is an updated version based on the code at <a href="http://blog.everythingflex.com/2007/06/18/simple-drag-and-drop-air/">http://blog.everythingflex.com/2007/06/18/simple-drag-and-drop-air/</a><br />
I’m on Windows so I’m using the mighty <a href="http://www.flashdevelop.org/community/">FlashDevelop</a>. The example below is using <a href="http://www.flashdevelop.org/community/viewtopic.php?f=11&#38;t=3470">3.0.0 Beta 8</a>.</p>
<p>1. Fire up FlashDevelop<br />
2. Select Project -&#62; New Project<br />
3. Select an AIR MXML Project and give it a sensible name (e.g. dnd)</p>
[caption id="attachment_85" align="alignnone" width="238" caption="Flash Develop"]<a href="http://goldenpebbles.files.wordpress.com/2008/09/dnd1.jpg"><img class="size-full wp-image-85" src="http://goldenpebbles.wordpress.com/files/2008/09/dnd1.jpg" alt="Flash Develop" width="238" height="235" /></a>[/caption]
<p>4. Expand the src directory and delete the Main.as file<br />
5. Replace the contents of the Main.mxml file with the following code (WP isn't keen on pasting in the indents - so no indents today).</p>
<pre>&#60;?xml version="1.0" encoding="utf-8"?&#62;
&#60;mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
creationComplete="init()"&#62;
&#60;mx:Script&#62;
&#60;![CDATA[
import flash.desktop.NativeDragActions;
import mx.controls.Alert;
import mx.controls.Image;
import flash.filesystem.File;
import flash.desktop.ClipboardFormats;
import flash.events.NativeDragEvent;
import flash.desktop.NativeDragManager;

private function init():void{
this.addEventListener(NativeDragEvent.NATIVE_DRAG_ENTER,onDragIn);
this.addEventListener(NativeDragEvent.NATIVE_DRAG_DROP,onDrop);
this.addEventListener(NativeDragEvent.NATIVE_DRAG_EXIT,onDragExit);
}

public function onDragIn(event:NativeDragEvent):void{
NativeDragManager.acceptDragDrop(this);
}

public function onDrop(event:NativeDragEvent):void{
NativeDragManager.dropAction = NativeDragActions.COPY;
var dropfiles:Array = event.clipboard.getData(ClipboardFormats.FILE_LIST_FORMAT) as Array;
for each (var file:File in dropfiles) {

//NB The following is case sensitive - so Image.JPG will produce "unmapped extension"
//but Image.jpg will work fine
trace("Adding file with extension [" + file.extension + "]");
switch (file.extension){
case "png" :
addImage(file.nativePath);
break;
case "jpg" :
addImage(file.nativePath);
break;
case "gif" :
addImage(file.nativePath);
break;
default:
Alert.show("Unmapped Extension");
}
}
}

public function onDragExit(event:NativeDragEvent):void{
trace("Drag exit event.");
}

private function addImage(nativePath:String):void{
var i:Image = new Image();
if(Capabilities.os.search("Mac") &#62;= 0){
i.source = "file://" + nativePath;
} else {
i.source = nativePath;
}
this.addChild(i);
}

]]&#62;
&#60;/mx:Script&#62;

&#60;/mx:WindowedApplication&#62;

 </pre>
<p>6. Hit F5 to test the application<br />
7. Drag images into the big empty window to see them shown there</p>
<p>Simple as that. You will notice inside the code that the app is looking for .png, .jpg, .gif files only. Turns out these suffixes are case sensitive inside Flex so make sure your file extensions are lower case. Or change the code.</p>
<p>Conclusion from this:</p>
<ol>
<li>If it's correct that HTML/JS can't be used to support drag and drop between the application and the desktop then this is not desperately surprising when you think about browser architecture, security, sandboxes and so forth.</li>
<li>If using Flash/Flex is the only way to address this challenge then so be it. My initial worry was that in order to use Flex in anger I'd have to hire a whole cadre of Flash/Flex developer/designers. But it turns out that Flex is very reminiscent of HTML and JavaScript/Java so there isn't going to be much of a learning curve for developers already familiar with web apps.</li>
<li>I'm glad this exercise forced me to have a look at Flex because it has a lot going for it as far as aspects of RIAs are concerned.</li>
<li>But. I have a concern about how maintainable Flex code is in the long run. <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=using_states_1.html">Check the example here about the use of View States</a>, in particular the example of how to maintain three different-sized windows. To be fair there are some <a href="http://blogs.warwick.ac.uk/stevencarpenter/entry/flex_mvc_frameworks/">MVC frameworks out there for Flex </a>but even so I would be tempted to keep AIR usage to the fringes of my applications for now.</li>
</ol>
]]></content:encoded>
</item>
<item>
<title><![CDATA[swapDepth in AS3 for drag n drop]]></title>
<link>http://nsdevaraj.wordpress.com/?p=88</link>
<pubDate>Mon, 25 Aug 2008 06:34:46 +0000</pubDate>
<dc:creator>nsdevaraj</dc:creator>
<guid>http://nsdevaraj.wordpress.com/2008/08/25/swapdepth-in-as3-for-drag-n-drop/</guid>
<description><![CDATA[The swapDepth is not available on AS3, rather much more simplest way is available.  
The below comme]]></description>
<content:encoded><![CDATA[<p>The swapDepth is not available on AS3, rather much more simplest way is available. :)</p>
<p>The below commented code can be achieved through the single line: <strong>event.target.parent.addChild(event.target);</strong></p>
<p>private var _dragIcon:MovieClip;<br />
dragIcon.addEventListener(MouseEvent.MOUSE_UP,onMouseUp, false, 0, true);<br />
dragIcon.addEventListener(MouseEvent.MOUSE_DOWN,onMouseDown, false, 0, true);</p>
<p>/*<br />
private var oldSwapDepth:int = 0;<br />
private var tempSwapDepth:int = 0;<br />
private function onMouseDown(event:MouseEvent):void<br />
{<br />
dragIcon.startDrag(false)<br />
tempSwapDepth = dragIcon.parent.getChildIndex(dragIcon);<br />
var newSwapDepth:int = dragIcon.parent.getChildIndex(swapDepthMc);<br />
newSwapDepth&#62;oldSwapDepth ? newSwapDepth = newSwapDepth : newSwapDepth =  oldSwapDepth;<br />
dragIcon.parent.setChildIndex(dragIcon,newSwapDepth)<br />
oldSwapDepth = dragIcon.parent.getChildIndex(dragIcon);<br />
}<br />
private function onMouseUp(event:MouseEvent):void         {<br />
dragIcon.stopDrag();<br />
dragIcon.parent.setChildIndex(dragIcon,tempSwapDepth);<br />
} */<br />
<strong>private function onMouseDown(event:MouseEvent):void<br />
{<br />
event.target.parent.addChild(event.target);<br />
}</strong></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Tutorials | Adobe Air Tutorials Roundup]]></title>
<link>http://flashenabled.wordpress.com/?p=2248</link>
<pubDate>Thu, 21 Aug 2008 20:30:13 +0000</pubDate>
<dc:creator>Carlos Pinho</dc:creator>
<guid>http://flashenabledblog.com/2008/08/21/tutorials-adobe-air-tutorials-roundup/</guid>
<description><![CDATA[Long time without posting on the desktop Adobe&#8217;s tool. So here it is a post full of great tuto]]></description>
<content:encoded><![CDATA[<p>Long time without posting on the desktop Adobe's tool. So here it is a post full of great tutorials on different areas such as Flash, Flex, JavaScript or html.</p>
<p class="singleh2"><strong><a title="Permanent Link to Creating A Downloader For YouTube with Flex/Air" rel="bookmark" href="http://www.thetechlabs.com/video/creating-a-downloader-for-youtube-with-flexair-2/">Creating A Downloader For YouTube with Air</a></strong></p>
<p class="singleh2"><img class="alignnone size-full wp-image-2249" src="http://flashenabled.wordpress.com/files/2008/08/creating-a-downloader-for-youtube-with-air.jpg" alt="" width="400" height="160" /></p>
<p class="singleh2">
<p><a href="http://www.sitepoint.com/article/adobe-air-todo-list-5-minutes" target="_blank"><strong>Create a To-do List in Five Minutes</strong></a></p>
<p><img class="alignnone size-full wp-image-2250" src="http://flashenabled.wordpress.com/files/2008/08/create-a-to-do-list-in-five-minutes.jpg" alt="" width="400" height="181" /></p>
<p><a href="http://www.adobe.com/devnet/air/flash/articles/insult_dueler.html" target="_blank"><strong>Building a Flash game on Adobe AIR</strong></a></p>
<p><img class="alignnone size-full wp-image-2251" src="http://flashenabled.wordpress.com/files/2008/08/building-a-flash-game-on-adobe-air.jpg" alt="" width="400" height="180" /></p>
<p><a href="http://www.senocular.com/air/tutorials/dragdropimageviewer/" target="_blank"><strong>Creating an Image Viewer in AIR With Drag and Drop</strong></a></p>
<p><img class="alignnone size-full wp-image-2252" src="http://flashenabled.wordpress.com/files/2008/08/creating-an-image-viewer-in-air-with-drag-and-drop.jpg" alt="" width="400" height="180" /></p>
<p><a href="http://www.sitepoint.com/article/voting-widget-flex-3-part-1" target="_blank"><strong>Build A Web 2.0 Voting Widget With Flex - Part I</strong></a></p>
<p><img class="alignnone size-full wp-image-2253" src="http://flashenabled.wordpress.com/files/2008/08/build-a-web-20-voting-widget-with-flex-part-i.jpg" alt="" width="400" height="180" /></p>
<p><a href="http://www.sitepoint.com/article/voting-widget-flex-3-part-2" target="_blank"><strong>Build A Web 2.0 Voting Widget With Flex - Part II</strong></a></p>
<p><img class="alignnone size-full wp-image-2254" src="http://flashenabled.wordpress.com/files/2008/08/build-a-web-20-voting-widget-with-flex-part-ii.jpg" alt="" width="400" height="180" /></p>
<p><!--more--></p>
<p><a href="http://www.adobe.com/devnet/air/ajax/articles/mapcache_on_air.html" target="_blank"><strong>Recreating MapCache on Adobe AIR</strong></a></p>
<p><img class="alignnone size-full wp-image-2255" src="http://flashenabled.wordpress.com/files/2008/08/recreating-mapcache-on-adobe-air.jpg" alt="" width="400" height="180" /></p>
<p class="singleh2"><strong><a title="Permanent Link to How to build a contact manager in AIR using XML - Part 2" rel="bookmark" href="http://www.thetechlabs.com/xml/how-to-build-a-contact-manager-in-air-using-xml-part-2/">How to build a contact manager in AIR using XML</a></strong></p>
<p class="singleh2"><img class="alignnone size-full wp-image-2256" src="http://flashenabled.wordpress.com/files/2008/08/how-to-build-a-contact-manager-in-air-using-xml.jpg" alt="" width="400" height="144" /></p>
<p class="singleh2">
<p class="singleh2"><strong><a href="http://www.adobe.com/newsletters/edge/august2008/articles/article7/index.html?trackingid=DLFXM" target="_blank">Create a Memory Game</a></strong></p>
<p class="singleh2"><img class="alignnone size-full wp-image-2257" src="http://flashenabled.wordpress.com/files/2008/08/create-a-memory-game.jpg" alt="" width="400" height="180" /></p>
<p class="singleh2">
]]></content:encoded>
</item>
<item>
<title><![CDATA[Como habilitar o “arrasta e solta” no Amsn (ubuntu 8.04)]]></title>
<link>http://rmbernardes.wordpress.com/?p=202</link>
<pubDate>Wed, 13 Aug 2008 18:27:28 +0000</pubDate>
<dc:creator>rmbernardes</dc:creator>
<guid>http://rmbernardes.wordpress.com/2008/08/13/como-habilitar-o-%e2%80%9carrasta-e-solta%e2%80%9d-no-amsn-ubuntu-804/</guid>
<description><![CDATA[
Uma das “in”funcionalidades mais chatas do amsn é o envio de arquivos.Ter que clicar em vária]]></description>
<content:encoded><![CDATA[<p><a href="http://rmbernardes.wordpress.com/files/2008/02/amsnlogo.jpg"><img class="alignnone size-medium wp-image-78" style="border:0 none;" src="http://rmbernardes.wordpress.com/files/2008/02/amsnlogo.jpg?w=300" alt="" width="300" height="230" /></a></p>
<p>Uma das “in”funcionalidades mais chatas do amsn é o envio de arquivos.Ter que clicar em várias pastas até achar o arquivo acaba sendo uma tarefa meio chata.<br />
Por isso criei este pequeno tutorial, que explica como habilitar o envio de arquivos apenas o arrastando para a janela de conversação.</p>
<p>1.Antes de iniciar, execute<br />
<code>apt-get install cvs</code></p>
<p>2.Execute <code>cvs -z3 -d:pserver:anonymous@tkdnd.cvs.sourceforge.net:/cvsroot/tkdnd login<br />
Logging in to :pserver:anonymous@tkdnd.cvs.sourceforge.net:2401/cvsroot/tkdnd<br />
</code> para criar o arquivo <strong>.cvspass</strong><br />
Na linha <strong>CVS password:</strong> apenas dê enter.</p>
<p>3.Agora você fará o download da lib tkdnd com o comando<br />
<code>cvs -z3 -d:pserver:anonymous@tkdnd.cvs.sourceforge.net:/cvsroot/tkdnd co -P tkdnd</code></p>
<p>4.Feito o download, entre no diretório tkdn e copie os arquivos listados abaixo para a pasta <strong>utils</strong> do amsn.<strong>No meu caso ela fica em /usr/local/share/amsn</strong>.É preciso também criar a pasta <strong>tkdnd</strong> dentro da pasta <strong>utils</strong>:<br />
<code><br />
mkdir /usr/local/share/amsn/utils/tkdnd<br />
cd tkdnd/lib<br />
cp *tcl /usr/local/share/amsn/utils/tkdnd/<br />
cd Linux<br />
cp libtkdnd1.0.so /usr/local/share/amsn/utils/tkdnd/</code></p>
<p>5.Restarte seu amsn e pronto!</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Shona is buying a Mac]]></title>
<link>http://howgoodisthat.wordpress.com/?p=952</link>
<pubDate>Mon, 11 Aug 2008 19:02:18 +0000</pubDate>
<dc:creator>Jim Gardner</dc:creator>
<guid>http://howgoodisthat.wordpress.com/2008/08/11/shonahasamac/</guid>
<description><![CDATA[Long time friend of the blog Shona, is buying a Mac Book and she&#8217;s hardly ever used OS X befor]]></description>
<content:encoded><![CDATA[<p><img src="http://howgoodisthat.wordpress.com/files/2008/08/apple-mac-book-better-specs-pic-1.jpg" width="50%" align="right" /><strong>Long time friend of the blog Shona, is buying a Mac Book and she's hardly ever used OS X before!</strong></p>
<p>You just don't hear about Dell users welcoming Sony users to the wonderful world of Windows Vista.  But we Mac users consider it something of duty, to make new users feel welcome - and what better way to say Hi, than a list of stuff to try out, once the excitement of taking your shiny new Mac from its box has given way to the joy of using the best operating system money can buy.</p>
<p>I've tried to list mostly tips which I find useful, but which it took me a while to find out about - rather than taking the time to verbosely list all of the immediately obvious functions which OS X is famed for and which are documented in the user guide, included with every new Mac.</p>
<h1>Keyboard shortcuts</h1>
<p>The list of undocumented key commands in OS X is seemingly endless.  I've been a Mac user for years and there's barely a month goes by when I'm not either reminded of a key combination I'd for