private Image DigitToImage(int digit, int healthRange)
{
Trace.Assert(healthRange <= 3);
if (healthRange == 0) healthRange = 1;
Trace.Assert(digit >= -1 && digit < 10);
string strDigit = "Slash";
if (digit != -1)
{
strDigit = digit.ToString();
}
string strColor = "Red";
if (healthRange == 2) strColor = "Yellow";
else if (healthRange == 3) strColor = "Green";
ImageSource source = Resources[string.Format("HealthBar.Digit.Small.{0}.{1}", strColor, strDigit)] as ImageSource;
Image image = new Image(){Source = source};
return image;
}