//************************************************************************* // Method: RetrieveVertexFromDrawingVisual() // /// <summary> /// Retrieves a vertex from the DrawingVisual with which the vertex was /// drawn. /// </summary> /// /// <param name="oDrawingVisual"> /// The DrawingVisual to retrieve a vertex from. /// </param> /// /// <returns> /// The vertex that was drawn with <paramref name="oDrawingVisual" />. /// </returns> /// /// <remarks> /// This method retrieves the vertex that was saved on a DrawingVisual by /// <see cref="SaveVertexOnDrawingVisual" />. /// </remarks> //************************************************************************* protected IVertex RetrieveVertexFromDrawingVisual( DrawingVisual oDrawingVisual ) { Debug.Assert(oDrawingVisual != null); AssertValid(); Object oVertexAsObject = oDrawingVisual.GetValue(FrameworkElement.TagProperty); Debug.Assert(oVertexAsObject is IVertex); return ( (IVertex)oVertexAsObject ); }