Fixed cast to ViewItem.