/// <summary>Sets a round corner to this border.</summary> /// <param name="corner">The property that it's going onto or coming from.</param> /// <param name="position">The type of corner that it is.</param> /// <param name="radius">The border radius.</param> public void SetCorner(ref RoundCorner corner,RoundCornerPosition position,int radius){ if(radius<=0){ if(corner!=null){ // Clear it: corner=null; // Got rounded corners now? bool hasRoundedCorners=( TopLeft!=null || TopRight!=null || BottomLeft!=null || BottomRight!=null ); if(!hasRoundedCorners){ // Clear the corner set: Border.Corners=null; } } return; } // A corner is now required: if(corner==null){ // Create it now: corner=new RoundCorner(this,position); } // Apply the radius: corner.Radius=radius; }
/// <summary>Sets a round corner to this border.</summary> /// <param name="corner">The property that it's going onto or coming from.</param> /// <param name="position">The type of corner that it is.</param> /// <param name="radius">The border radius.</param> public void SetCorner(ref RoundCorner corner, RoundCornerPosition position, int radius) { if (radius <= 0) { if (corner != null) { // Clear it: corner = null; // Got rounded corners now? bool hasRoundedCorners = ( TopLeft != null || TopRight != null || BottomLeft != null || BottomRight != null ); if (!hasRoundedCorners) { // Clear the corner set: Border.Corners = null; } } return; } // A corner is now required: if (corner == null) { // Create it now: corner = new RoundCorner(this, position); } // Apply the radius: corner.Radius = radius; }