PathFigure pathFigure = new PathFigure(); // Add points to the pathfigure pathFigure.StartPoint = new Point(0, 0); pathFigure.Segments.Add(new LineSegment(new Point(50, 0), true)); pathFigure.Segments.Add(new LineSegment(new Point(50, 50), true)); pathFigure.Segments.Add(new LineSegment(new Point(0, 50), true)); // Freeze the pathfigure pathFigure.Freeze(); // Create a read-only copy of the pathfigure PathFigure readOnlyPathFigure = pathFigure.GetAsFrozen() as PathFigure;In this example, we create a new PathFigure object and add some points to it. We then call the Freeze() method to create a frozen copy of the object. Finally, we use the GetAsFrozen() method to create a read-only copy of the frozen object. The System.Windows.Media PathFigure Freeze method is included in the System.Windows.PresentationCore package library.