Gets or sets a Brush to use when painting the element's border. This is a dependency property.
Assembly: PresentationFramework (in PresentationFramework.dll)
<FlowDocument> <Paragraph Name="par" BorderBrush="Blue" BorderThickness="0.25in" > <Run> Child elements in this Block element (Paragraph) will be surrounded by a blue border. </Run> <LineBreak/><LineBreak/> <Run> This border will be one quarter inch thick in all directions. </Run> </Paragraph> </FlowDocument>
The following figure shows how this example renders.
The following example shows how to set the BorderBrush property programmatically.
Paragraph par = new Paragraph(); Run run1 = new Run("Child elements in this Block element (Paragraph) will be surrounded by a blue border."); Run run2 = new Run("This border will be one quarter inch thick in all directions."); par.Inlines.Add(run1); par.Inlines.Add(run2); par.BorderBrush = Brushes.Blue; ThicknessConverter tc = new ThicknessConverter(); par.BorderThickness = (Thickness)tc.ConvertFromString("0.25in");
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.