I'm looking for a sample wizard control for UWP. I am looking for a control that uses forward and backward buttons to transition from one panel to the next.
I have tried to implement my own by animating the width of panels in a horizontally oriented StackPanel, but it doesn't work as expected (the width is not animated and reverts back).
<Page.Resources>
<Storyboard x:Name="GoToNextAnimation" Storyboard.TargetName="LeftPanel">
<DoubleAnimation Storyboard.TargetProperty="Width" From="100" To="0" AutoReverse="False" Duration="0:0:1" />
</Storyboard>
</Page.Resources>
<StackPanel Orientation="Horizontal" Width="100" Tapped="StackPanel_Tapped" Background="Red" Height="50">
<Button x:Name="LeftPanel" Background="Yellow" Width="100" Height="50" />
<Button x:Name="RightPanel" Background="Green" Width="100" Height="50" />
</StackPanel>
with the event handler beginning the animation:
bool isLeft = true;
private void StackPanel_Tapped(object sender, TappedRoutedEventArgs e)
{
if (isLeft)
{
GoToNextAnimation.Begin();
}
else
{
LeftPanel.Width = 100;
}
isLeft = !isLeft;
}
When I tep the control it briefly (much quicker than the animation is intended to run for) changes to the red color (background of StackPanel) before reverting back to yellow (*never showing the green for the RightPanel).