/// <summary> /// Override this to change the appearance of the main area /// </summary> /// <param name="drawingContext"></param> protected override void OnRender(DrawingContext drawingContext) { var borderPen = (Pen)FindResource(Globals.AdornerBorderPen); var renderBrush = (Brush)FindResource(Globals.AdornerFillBrush); if (IsWorking) { object elem = AdornedElement; //identify which Molecule the atom belongs to //take a snapshot of the molecule if (_ghostMolecule == null) { _ghostMolecule = CurrentEditor.GhostMolecule(AdornedMolecules); } _ghostMolecule.Transform = LastOperation; drawingContext.DrawGeometry(renderBrush, borderPen, _ghostMolecule); base.OnRender(drawingContext); } }
protected override void OnRender(DrawingContext drawingContext) { base.OnRender(drawingContext); var brush = (Brush)FindResource(Globals.AdornerBorderBrush); var pen = new Pen(brush, 1.0); if (!(BigThumb.IsDragging || TopLeftHandle.IsDragging || TopRightHandle.IsDragging || BottomLeftHandle.IsDragging || BottomRightHandle.IsDragging)) { drawingContext.DrawLine(pen, _centroid, _rotateThumbPos); drawingContext.DrawEllipse(brush, pen, _centroid, 2, 2); } if (IsWorking) { //identify which Molecule the atom belongs to //take a snapshot of the molecule var ghost = CurrentEditor.GhostMolecule(AdornedMolecules); ghost.Transform = LastOperation; drawingContext.DrawGeometry(brush, pen, ghost); } }