Skip to content

Commit cc30076

Browse files
committed
Update Countdown.cs
1 parent 9b3c88d commit cc30076

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

dev/DevWinUI.Controls/Controls/Win2D/Countdown/Countdown.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ private void OnCanvasDraw(ICanvasAnimatedControl sender, CanvasAnimatedDrawEvent
225225
case CountdownState.Normal:
226226
default:
227227
backgroundBrush = backgroundDefaultBrush;
228-
borderBrush = _text == null ? borderGradientBrush : borderDefaultBrush;
228+
borderBrush = string.IsNullOrEmpty(_text) ? borderGradientBrush : borderDefaultBrush;
229229
break;
230230
}
231231

@@ -253,8 +253,14 @@ private void OnCanvasDraw(ICanvasAnimatedControl sender, CanvasAnimatedDrawEvent
253253
}
254254
}
255255

256-
// Draw the foreground.
257-
session.DrawText(_text ?? _countdownSeconds.ToString(), textPosition, _textForeground, _textFormat);
256+
if (string.IsNullOrEmpty(_text))
257+
{
258+
session.DrawText(_countdownSeconds.ToString(), textPosition, _textForeground, _textFormat);
259+
}
260+
else
261+
{
262+
session.DrawText(_text, textPosition, _textForeground, _textFormat);
263+
}
258264
}
259265

260266
private void UpdateCanvas()

0 commit comments

Comments
 (0)