Although this is not using a dockable window, I do have an addin project where I have a form with buttons on it to draw different shapes on the maps (DrawFeatures). I also have a separate tool (DrawTool) in the project that does all the interaction with the map.
In the DrawFeatures code, the button click subroutine sets the current tool the DrawTool
Dim pUID As New ESRI.ArcGIS.esriSystem.UID
Dim pCommandItem As ESRI.ArcGIS.Framework.ICommandItem
pUID.Value = My.ThisAddIn.IDs.DrawTool
pCommandItem = m_application.Document.CommandBars.Find(pUID, False, False)
m_application.CurrentTool = pCommandItem
And here's what the DrawTool code looks like
Public Class DrawTool
Inherits ESRI.ArcGIS.Desktop.AddIns.Tool
'Public LineType As String
Private m_LineFeedback As ESRI.ArcGIS.Display.INewBezierCurveFeedback = Nothing
Private graphicsContainer As ESRI.ArcGIS.Carto.IGraphicsContainer
Public Sub New()
End Sub
Protected Overrides Sub OnUpdate()
End Sub
Protected Overrides Sub OnMouseDown(ByVal arg As ESRI.ArcGIS.Desktop.AddIns.Tool.MouseEventArgs)
MyBase.OnMouseDown(arg)
//code to do all the drawing
End Sub
Protected Overrides Sub OnMouseMove(arg As ESRI.ArcGIS.Desktop.AddIns.Tool.MouseEventArgs)
MyBase.OnMouseMove(arg)
Try
If m_LineFeedback IsNot Nothing Then
Dim pPoint As ESRI.ArcGIS.Geometry.IPoint = My.ArcMap.Document.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(arg.X, arg.Y)
m_LineFeedback.AddPoint(pPoint)
End If
Catch ex As Exception
System.Windows.Forms.MessageBox.Show(ex.ToString)
End Try
End Sub