You need to execute your code for calculating eatenAppleCount
before showing it in the message.
It appears you are just using the default value of eatenAppleCount
and then you are calculating it.
int eatenAppleCount = 0;
public MainPage()
{
for (int indx = myapples.Count - 1; indx >= 0; indx--)
{
myapples[indx].Update(LayoutRoot);
bool collided = DetectCollision(myapples[indx], myPig);
if (collided)
{
eatenAppleCount ++;
RemoveApple(myapples[indx]);
}
}
score.Content = "Score" + " " + Convert.ToString(eatenAppleCount);
}