Moved animation control from view code-behind to behaviour class which is used in the main view's xaml.