Click here to Skip to main content
15,881,852 members
Articles / Desktop Programming / WPF

Dragging Elements in a Canvas

Rate me:
Please Sign up or sign in to vote.
4.95/5 (11 votes)
8 Jun 2012CPOL5 min read 49.2K   3.2K   22  
This is an alternative for "Dragging Elements in a Canvas"
  • DragCanvas.zip
    • DragCanvas
      • _ReSharper.DragCanvas
        • BuildScriptCache
          • .crc
          • .version
          • 0
            • 183e9cc0.dat
        • ConditionalNames
          • .crc
          • .version
          • 1
            • 5a1de9b0.dat
        • JavaScriptCache
          • .crc
          • .version
          • 1
            • 57e4b5d7.dat
        • JbDecompilerCache
        • JbPdbInfo
          • 4f0040e686d038e9636dff1d1baebd15770a5a74
        • JSTest
          • .crc
          • .version
        • ModuleIds.xml
        • MVC
          • .crc
          • .version
        • NamedArguments
          • .crc
          • .version
          • 3
            • 6666e456.dat
        • PersistenIdIndex.bin
        • Resources
          • .crc
          • .version
          • 3
            • 2c5e2a5a.dat
        • SymbolCache.bin
        • TagPrefixes
          • .crc
          • .version
        • TodoItems
          • .crc
          • .version
          • 0
            • 5e35e2c3.dat
        • WebSymbols
          • .crc
          • .version
        • WordIndex
          • .crc
          • .version
          • 5
            • 3309c5e5.dat
        • XmlIndex
          • Accessibility.xml
            • 97C5C74B.bin
          • Microsoft.VisualC.xml
            • 3732B488.bin
          • mscorlib.2.0.0.0.Contracts.xml
            • 669653D2.bin
          • mscorlib.2.0.0.0.Interfaces.Nullness.Generated.xml
            • A2A75BDA.bin
          • mscorlib.2.0.0.0.Nullness.Generated.xml
            • D26B4A42.bin
          • mscorlib.2.0.0.0.Pure.xml
            • B9983081.bin
          • mscorlib.I18n.xml
            • 0AA1DA3F.bin
          • mscorlib.Nullness.Manual.xml
            • A44AFA55.bin
          • mscorlib.ValueFlow.xml
            • D2DAC228.bin
          • mscorlib.xml
            • 1D362982.bin
            • 48F8C2BF.bin
          • PresentationCFFRasterizer.3.0.0.0.Nullness.Generated.xml
            • B4D13C03.bin
          • PresentationCFFRasterizer.xml
            • D42F980E.bin
          • PresentationCore.3.0.0.0.Nullness.Generated.xml
            • 66BDC3A3.bin
          • PresentationCore.xml
            • EDA88970.bin
          • PresentationFramework.3.0.0.0.Nullness.Generated.xml
            • 97288583.bin
          • PresentationFramework.3.0.0.0.Xaml.xml
            • 1C5E49AA.bin
          • PresentationFramework.Nullness.Manual.xml
            • 1C3AA775.bin
          • PresentationFramework.xml
            • 040E2517.bin
          • PresentationUI.3.0.0.0.Nullness.Generated.xml
            • D3F1EA83.bin
          • PresentationUI.xml
            • DF304316.bin
          • ReachFramework.3.0.0.0.Nullness.Generated.xml
            • 22E21C63.bin
          • ReachFramework.xml
            • E2EA471C.bin
          • System.2.0.0.0.Contracts.xml
            • B40F3D52.bin
          • System.2.0.0.0.Nullness.Generated.xml
            • 6A42E3C2.bin
          • System.2.0.0.0.Pure.xml
            • 8BF92A01.bin
          • System.Configuration.2.0.0.0.Contracts.xml
            • A7D7CCD2.bin
          • System.Configuration.2.0.0.0.Nullness.Generated.xml
            • 0B64E342.bin
          • System.Configuration.2.0.0.0.Pure.xml
            • 24CA0981.bin
          • System.Configuration.Install.2.0.0.0.Contracts.xml
            • 88A16EF2.bin
          • System.Configuration.Install.2.0.0.0.Nullness.Generated.xml
            • FF1197A2.bin
          • System.Configuration.Install.xml
            • 3B89BCB1.bin
          • System.Configuration.xml
            • 2AA4525E.bin
          • System.Core.3.5.0.0.Contracts.xml
            • E85BCEF6.bin
          • System.Core.3.5.0.0.Nullness.Generated.xml
            • FA15F726.bin
          • System.Core.3.5.0.0.Pure.xml
            • 720DBBA5.bin
          • System.Core.LinqTunnel.xml
            • D9B819C3.bin
          • System.Core.Nullness.Manual.xml
            • 693BFE35.bin
          • System.Core.xml
            • C79339FF.bin
          • System.Data.2.0.0.0.Contracts.xml
            • 6CEC9372.bin
          • System.Data.2.0.0.0.Nullness.Generated.xml
            • 696DCC22.bin
          • System.Data.2.0.0.0.Pure.xml
            • 6C5FA0A1.bin
          • System.Data.DataSetExtensions.3.5.0.0.Nullness.Generated.xml
            • 02514626.bin
          • System.Data.DataSetExtensions.I18n.xml
            • FA1E61DF.bin
          • System.Data.DataSetExtensions.xml
            • C95F1C82.bin
          • System.Data.I18n.xml
            • 4BA2745F.bin
          • System.Data.OracleClient.2.0.0.0.Nullness.Generated.xml
            • 46DBA7A2.bin
          • System.Data.OracleClient.xml
            • 9427B35F.bin
          • System.Data.SqlXml.2.0.0.0.Nullness.Generated.xml
            • 9DA2DB22.bin
          • System.Data.SqlXml.xml
            • 8761C3C7.bin
          • System.Data.xml
            • CFFAA41E.bin
          • System.Deployment.2.0.0.0.Nullness.Generated.xml
            • A29CBF22.bin
          • System.Deployment.xml
            • 2C6EE0D7.bin
          • System.Design.2.0.0.0.Nullness.Generated.xml
            • C67F00E2.bin
          • System.Design.xml
            • 94F2BB5C.bin
          • System.DirectoryServices.2.0.0.0.Nullness.Generated.xml
            • F9F88CA2.bin
          • System.DirectoryServices.Protocols.2.0.0.0.Nullness.Generated.xml
            • EA572402.bin
          • System.DirectoryServices.Protocols.xml
            • 072F5742.bin
          • System.DirectoryServices.xml
            • 796A6F49.bin
          • System.Drawing.2.0.0.0.Contracts.xml
            • 3AD69D12.bin
          • System.Drawing.2.0.0.0.Nullness.Generated.xml
            • DE857C82.bin
          • System.Drawing.2.0.0.0.Pure.xml
            • 85473141.bin
          • System.Drawing.Design.2.0.0.0.Nullness.Generated.xml
            • 89687CE2.bin
          • System.Drawing.Design.xml
            • 7000BF52.bin
          • System.Drawing.xml
            • 4AE71CCE.bin
          • System.EnterpriseServices.2.0.0.0.Nullness.Generated.xml
            • 75FE90A2.bin
          • System.EnterpriseServices.xml
            • 5D2D9EF5.bin
          • System.I18n.xml
            • 7E6153BF.bin
          • System.Nullness.Manual.xml
            • 637B83D5.bin
          • System.Printing.3.0.0.0.Nullness.Generated.xml
            • E6FC4D43.bin
          • System.Printing.xml
            • 11CADEE7.bin
          • System.Runtime.Remoting.2.0.0.0.Nullness.Generated.xml
            • 3BD7CBE2.bin
          • System.Runtime.Remoting.xml
            • F93434DD.bin
          • System.Runtime.Serialization.Formatters.Soap.2.0.0.0.Contracts.xml
            • 02345952.bin
          • System.Runtime.Serialization.Formatters.Soap.2.0.0.0.Nullness.Generated.xml
            • 99E77FC2.bin
          • System.Runtime.Serialization.Formatters.Soap.4.0.0.0.Contracts.xml
            • 55A979D4.bin
          • System.Runtime.Serialization.Formatters.Soap.xml
            • FD932A2C.bin
          • System.Security.2.0.0.0.Contracts.xml
            • 531341F2.bin
          • System.Security.2.0.0.0.Nullness.Generated.xml
            • CE40CAA2.bin
          • System.Security.2.0.0.0.Pure.xml
            • 0D7F3F21.bin
          • System.Security.xml
            • 07099898.bin
          • System.ServiceProcess.2.0.0.0.Nullness.Generated.xml
            • DCACE422.bin
          • System.ServiceProcess.xml
            • B46FDC38.bin
          • System.Transactions.2.0.0.0.Nullness.Generated.xml
            • BEE213A2.bin
          • System.Transactions.xml
            • 7D351899.bin
          • System.Web.2.0.0.0.Contracts.xml
            • E160C612.bin
          • System.Web.2.0.0.0.Nullness.Generated.xml
            • 318DC582.bin
          • System.Web.2.0.0.0.Pure.xml
            • 0993BA41.bin
          • System.Web.Attributes.xml
            • 33EA9D5E.bin
          • System.Web.I18n.xml
            • C6FEF5FF.bin
          • System.Web.RegularExpressions.xml
            • CD932B2B.bin
          • System.Web.Services.2.0.0.0.Nullness.Generated.xml
            • A65D29A2.bin
          • System.Web.Services.Attributes.xml
            • C138893E.bin
          • System.Web.Services.xml
            • 357F9EBE.bin
          • System.Web.xml
            • 03E9D35E.bin
          • System.Windows.Forms.2.0.0.0.Contracts.xml
            • C99021D2.bin
          • System.Windows.Forms.2.0.0.0.Nullness.Generated.xml
            • 1E4CD842.bin
          • System.Windows.Forms.2.0.0.0.Pure.xml
            • 77B93E81.bin
          • System.Windows.Forms.I18n.xml
            • B794E83F.bin
          • System.Windows.Forms.Manual.xml
            • BA60B1CB.bin
          • System.Windows.Forms.xml
            • 82C195DA.bin
          • System.Xml.2.0.0.0.Contracts.xml
            • A6332332.bin
          • System.Xml.2.0.0.0.Nullness.Generated.xml
            • DBEE78E2.bin
          • System.Xml.2.0.0.0.Pure.xml
            • 96E3DDE1.bin
          • System.Xml.Attributes.xml
            • F9C6A9FE.bin
          • System.Xml.I18n.xml
            • E864609F.bin
          • System.Xml.Linq.3.5.0.0.Contracts.xml
            • 350F1BF6.bin
          • System.Xml.Linq.3.5.0.0.Nullness.Generated.xml
            • 6DCFE426.bin
          • System.Xml.Linq.3.5.0.0.Pure.xml
            • F13CE8A5.bin
          • System.Xml.Linq.I18n.xml
            • 7A027FDF.bin
          • System.Xml.Linq.xml
            • C650FFA9.bin
          • System.Xml.xml
            • 3B538D57.bin
          • System.xml
            • 07464C3F.bin
            • CA128980.bin
          • UIAutomationProvider.3.0.0.0.Nullness.Generated.xml
            • 77162843.bin
          • UIAutomationProvider.xml
            • ADB2249F.bin
          • UIAutomationTypes.3.0.0.0.Nullness.Generated.xml
            • B855C303.bin
          • UIAutomationTypes.xml
            • 310076D5.bin
          • WindowsBase.3.0.0.0.Nullness.Generated.xml
            • 96394F03.bin
          • WindowsBase.3.0.0.0.Pure.xml
            • EB21A780.bin
          • WindowsBase.xml
            • 6A80BA17.bin
      • DragCanvas.sln
      • DragCanvas.suo
      • DragCanvas
  • DragCanvas.zip
    • .crc
    • .version
    • 183e9cc0.dat
    • .crc
    • .version
    • 5a1de9b0.dat
    • .crc
    • .version
    • 57e4b5d7.dat
    • Assembly.Location.txt
    • Canvas.cs
    • Canvas.cs.flags
    • Canvas.cs.info
    • 4f0040e686d038e9636dff1d1baebd15770a5a74
    • .crc
    • .version
    • ModuleIds.xml
    • .crc
    • .version
    • .crc
    • .version
    • 6666e456.dat
    • PersistenIdIndex.bin
    • .crc
    • .version
    • 2c5e2a5a.dat
    • SymbolCache.bin
    • .crc
    • .version
    • .crc
    • .version
    • 5e35e2c3.dat
    • .crc
    • .version
    • .crc
    • .version
    • 3309c5e5.dat
    • 97C5C74B.bin
    • 3732B488.bin
    • 669653D2.bin
    • A2A75BDA.bin
    • D26B4A42.bin
    • B9983081.bin
    • 0AA1DA3F.bin
    • A44AFA55.bin
    • D2DAC228.bin
    • 1D362982.bin
    • 48F8C2BF.bin
    • B4D13C03.bin
    • D42F980E.bin
    • 66BDC3A3.bin
    • EDA88970.bin
    • 97288583.bin
    • 1C5E49AA.bin
    • 1C3AA775.bin
    • 040E2517.bin
    • D3F1EA83.bin
    • DF304316.bin
    • 22E21C63.bin
    • E2EA471C.bin
    • B40F3D52.bin
    • 6A42E3C2.bin
    • 8BF92A01.bin
    • A7D7CCD2.bin
    • 0B64E342.bin
    • 24CA0981.bin
    • 88A16EF2.bin
    • FF1197A2.bin
    • 3B89BCB1.bin
    • 2AA4525E.bin
    • E85BCEF6.bin
    • FA15F726.bin
    • 720DBBA5.bin
    • D9B819C3.bin
    • 693BFE35.bin
    • C79339FF.bin
    • 6CEC9372.bin
    • 696DCC22.bin
    • 6C5FA0A1.bin
    • 02514626.bin
    • FA1E61DF.bin
    • C95F1C82.bin
    • 4BA2745F.bin
    • 46DBA7A2.bin
    • 9427B35F.bin
    • 9DA2DB22.bin
    • 8761C3C7.bin
    • CFFAA41E.bin
    • A29CBF22.bin
    • 2C6EE0D7.bin
    • C67F00E2.bin
    • 94F2BB5C.bin
    • F9F88CA2.bin
    • EA572402.bin
    • 072F5742.bin
    • 796A6F49.bin
    • 3AD69D12.bin
    • DE857C82.bin
    • 85473141.bin
    • 89687CE2.bin
    • 7000BF52.bin
    • 4AE71CCE.bin
    • 75FE90A2.bin
    • 5D2D9EF5.bin
    • 7E6153BF.bin
    • 637B83D5.bin
    • E6FC4D43.bin
    • 11CADEE7.bin
    • 3BD7CBE2.bin
    • F93434DD.bin
    • 02345952.bin
    • 99E77FC2.bin
    • 55A979D4.bin
    • FD932A2C.bin
    • 531341F2.bin
    • CE40CAA2.bin
    • 0D7F3F21.bin
    • 07099898.bin
    • DCACE422.bin
    • B46FDC38.bin
    • BEE213A2.bin
    • 7D351899.bin
    • E160C612.bin
    • 318DC582.bin
    • 0993BA41.bin
    • 33EA9D5E.bin
    • C6FEF5FF.bin
    • CD932B2B.bin
    • A65D29A2.bin
    • C138893E.bin
    • 357F9EBE.bin
    • 03E9D35E.bin
    • C99021D2.bin
    • 1E4CD842.bin
    • 77B93E81.bin
    • B794E83F.bin
    • BA60B1CB.bin
    • 82C195DA.bin
    • A6332332.bin
    • DBEE78E2.bin
    • 96E3DDE1.bin
    • F9C6A9FE.bin
    • E864609F.bin
    • 350F1BF6.bin
    • 6DCFE426.bin
    • F13CE8A5.bin
    • 7A027FDF.bin
    • C650FFA9.bin
    • 3B538D57.bin
    • 07464C3F.bin
    • CA128980.bin
    • 77162843.bin
    • ADB2249F.bin
    • B855C303.bin
    • 310076D5.bin
    • 96394F03.bin
    • EB21A780.bin
    • 6A80BA17.bin
    • DragCanvas.sln
    • DragCanvas.suo
    • app.config
    • App.xaml
    • App.xaml.cs
    • DragCanvas.exe
    • DragCanvas.exe.config
    • DragCanvas.pdb
    • DragCanvas.vshost.exe
    • DragCanvas.vshost.exe.config
    • DragCanvas.vshost.exe.manifest
    • DragCanvas.cs
    • DragCanvas.csproj
    • Cog.png
    • InfoBox.xaml
    • InfoBox.xaml.cs
    • MainWindow.xaml
    • MainWindow.xaml.cs
    • App.g.cs
    • DesignTimeResolveAssemblyReferences.cache
    • DesignTimeResolveAssemblyReferencesInput.cache
    • DragCanvas.csproj.FileListAbsolute.txt
    • DragCanvas.exe
    • DragCanvas.g.resources
    • DragCanvas.pdb
    • DragCanvas.Properties.Resources.resources
    • DragCanvas_MarkupCompile.cache
    • DragCanvas_MarkupCompile.i.cache
    • DragCanvas_MarkupCompile.i.lref
    • DragCanvas_MarkupCompile.lref
    • GeneratedInternalTypeHelper.g.cs
    • GenerateResource.read.1.tlog
    • GenerateResource.write.1.tlog
    • GenerateResource-ResGen.read.1.tlog
    • GenerateResource-ResGen.write.1.tlog
    • InfoBox.baml
    • InfoBox.g.cs
    • MainWindow.baml
    • MainWindow.g.cs
    • Properties.Resources.Designer.cs.dll
    • AssemblyInfo.cs
    • Resources.Designer.cs
    • Resources.resx
    • Settings.Designer.cs
    • Settings.settings
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;

// General Information about an assembly is controlled through the following 
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DragCanvas")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DragCanvas")]
[assembly: AssemblyCopyright("Copyright ©  2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible 
// to COM components.  If you need to access a type in this assembly from 
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

//In order to begin building localizable applications, set 
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>.  For example, if you are using US english
//in your source files, set the <UICulture> to en-US.  Then uncomment
//the NeutralResourceLanguage attribute below.  Update the "en-US" in
//the line below to match the UICulture setting in the project file.

//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]


[assembly: ThemeInfo(
    ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
    //(used if a resource is not found in the page, 
    // or application resource dictionaries)
    ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
    //(used if a resource is not found in the page, 
    // app, or any theme specific resource dictionaries)
)]


// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version 
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Build and Revision Numbers 
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer Korentec
Israel Israel
Laziness Is The Engine of Science and Progress

Comments and Discussions