Basically your code is working fine. The only change we've made is to moved the switch logic in the Loaded event as the control template needs a time to be loaded. This is the reason why it is not worked initially.
For your convenience we've added a sample project as an attached file where you can see our approach.
We hope that the solution will fit to your needs.
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos
and start improving your app based on facts, not hunches.