I suggest you ...

VisualStateManager Storyboard TargetName should be checked

I think one of the most common failures of Windows Store apps certification is crash related to snap view. It is often caused by removing or renaming of XAML elements, which still preservs in the VisualStateManager.

For example this causes a runtime crash when backButton element does not exists:
<VisualStateManager.VisualStateGroups>

<!-- Visual states reflect the application's view state -->
<VisualStateGroup x:Name="ApplicationViewStates">
<VisualState x:Name="FullScreenLandscape"/>
<VisualState x:Name="Filled"/>

<!-- The entire page respects the narrower 100-pixel margin convention for portrait -->
<VisualState x:Name="FullScreenPortrait">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PortraitBackButtonStyle}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>

<!-- The back button and title have different styles when snapped -->
<VisualState x:Name="Snapped">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedBackButtonStyle}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>

I think Visual Studio should check if elements names mentioned in Storyboard.TargetName really exists. If not, it should cause a compile time error. Runtime error is too late for this.

I have previously mentioned it here: http://social.msdn.microsoft.com/Forums/en-US/toolsforwinapps/thread/875c4985-64c7-4352-a4be-1d2913de75f7

7 votes
Vote
Sign in
(thinking…)
Password icon
Signed in as (Sign out)
You have left! (?) (thinking…)
Václav Dajbych shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

Thank you for your suggestion! While we aim to respond to every suggestion, we are closing older ones that don’t have enough votes so newer ones from you can move to the top. If this suggestion is still important to you, feel free to open it again.

0 comments

Sign in
(thinking…)
Password icon
Signed in as (Sign out)
Submitting...

Feedback and Knowledge Base