It's perhaps as WPF and XAML try to achieve more then JS. I guess it is also as they want put as much as possible into XAML. You could alsways do it in code behind by using different classes and methods.
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
It's perhaps as WPF and XAML try to achieve more then JS. I guess it is also as they want put as much as possible into XAML. You could alsways do it in code behind by using different classes and methods.