@@ -10,7 +10,7 @@ public class OutlinedTextBlock : FrameworkElement, IAddChild
1010{
1111 #region Private Fields
1212
13- private Geometry _textGeometry ;
13+ private Geometry ? _textGeometry ;
1414
1515 #endregion Private Fields
1616
@@ -38,12 +38,12 @@ public void CreateText()
3838 FontStyle fontStyle = FontStyles . Normal ;
3939 FontWeight fontWeight = FontWeights . Medium ;
4040
41- if ( Bold == true )
41+ if ( Bold )
4242 {
4343 fontWeight = FontWeights . Bold ;
4444 }
4545
46- if ( Italic == true )
46+ if ( Italic )
4747 {
4848 fontStyle = FontStyles . Italic ;
4949 }
@@ -55,13 +55,12 @@ public void CreateText()
5555 FlowDirection . LeftToRight ,
5656 new Typeface ( Font , fontStyle , fontWeight , FontStretches . Normal ) ,
5757 FontSize ,
58- Brushes . Black // This brush does not matter since we use the geometry of the text.
59- ) ;
58+ Brushes . Black , // This brush does not matter since we use the geometry of the text.
59+ 1 ) ;
6060
6161 // Build the geometry object that represents the text.
6262 _textGeometry = formattedText . BuildGeometry ( new Point ( 0 , 0 ) ) ;
6363
64- //set the size of the custome control based on the size of the text
6564 MinWidth = formattedText . Width ;
6665 MinHeight = formattedText . Height ;
6766 }
@@ -73,7 +72,6 @@ public void CreateText()
7372 protected override void OnRender ( DrawingContext drawingContext )
7473 {
7574 CreateText ( ) ;
76- // Draw the outline based on the properties that are set.
7775 drawingContext . DrawGeometry ( Fill , new Pen ( Stroke , StrokeThickness ) , _textGeometry ) ;
7876 }
7977
@@ -252,7 +250,7 @@ public bool Italic
252250 }
253251
254252 /// <summary>
255- /// Specifies the brush to use for the stroke and optional hightlight of the formatted text.
253+ /// Specifies the brush to use for the stroke and optional highlight of the formatted text.
256254 /// </summary>
257255 public Brush Stroke
258256 {
@@ -262,7 +260,7 @@ public Brush Stroke
262260 }
263261
264262 /// <summary>
265- /// The stroke thickness of the font.
263+ /// The stroke thickness of the font.
266264 /// </summary>
267265 public ushort StrokeThickness
268266 {
@@ -285,9 +283,9 @@ public void AddChild(object value)
285283 {
286284 }
287285
288- public void AddText ( string value )
286+ public void AddText ( string text )
289287 {
290- Text = value ;
288+ Text = text ;
291289 }
292290
293291 #endregion DependencyProperties
0 commit comments