RetrieveVertexFromDrawingVisual ( DrawingVisual oDrawingVisual ) { Debug.Assert(oDrawingVisual != null); AssertValid(); Object oVertexAsObject = oDrawingVisual.GetValue(FrameworkElement.TagProperty); Debug.Assert(oVertexAsObject is IVertex); return((IVertex)oVertexAsObject); }
/// <summary> /// 清空舞台 /// </summary> public void ClearStage() { // 几何对象 AShape shape = null; // 图形对象 DrawingVisual brush = null; for (int i = this.panel.AmountVisual() - 1; i > -1; i--) { if (!MatchUtils.IsEmpty(brush = this.panel.ObtainVisual(i) as DrawingVisual) && !MatchUtils.IsEmpty(shape = brush.GetValue(MagicGraphic.Nexus) as AShape)) { shape.Earse(); { shape = null; brush = null; } } } }