Define counter as property so it synchs between views.

Fixes #2327.