I'm having a minor issue with my current app, dealing with visual states and automatic / static widths.
Depending on the visual state, a StackPanel
either has a width="Auto" or width="400". Blend is telling me I can't animate between these two values (and I'm not really animating here, but simply switching between a fullscreen video and a composite view). Now I have to do an explicit test and change the width when I change my Visual State (through the VisualStateManager
-framework. Is there any way I can do this in XAML (through the storyboards) instead of in the codebehind?
Some code samples of what I'm doing today:
private void Trailer_OnFullScreenToggled(object sender, EventArgs e)
{
var state = (Trailer.IsFullScreen() ? "Windowed" : "Fullscreen");
// HACK: Done to get past the auto / px issue
VisualsGrid.Width = Trailer.IsFullScreen() ? 400.0 : Double.NaN;
VisualStateManager.GoToState(this, state, true);
}
Any help would be greatly appreciated!