locked
Amateur Question: Can't Activate States in Sketchflow Player RRS feed

  • Question

  • I am unable to get ActivateStateAction behaviors attached to a basic sketch-style button to work in Sketchflow Player. The states themselves work fine when selected individually in the player's "Navigate" list on the left. Please ask for any other information necessary. I will keep it simple so I don't waste time with unnecessary details. Why won't the ShowCustomerServiceDialog and ModalBG states activate when I click the CustomerServiceButton in the player?

    Thank you very much in advance!

    <UserControl
    	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    	xmlns:System="clr-namespace:System;assembly=mscorlib" xmlns:local="clr-namespace:CactusTest1Screens" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:pi="http://schemas.microsoft.com/prototyping/2010/interactivity"
    	xmlns:pc="http://schemas.microsoft.com/prototyping/2010/controls"
    	mc:Ignorable="d"
    	x:Class="CactusTest1Screens.Welcome"
    	Width="1020" Height="768">
    
    	<Grid x:Name="LayoutRoot">
    		<VisualStateManager.VisualStateGroups>
    			<VisualStateGroup x:Name="Modal">
    				<VisualState x:Name="ModalBG">
    					<Storyboard>
    						<DoubleAnimation Duration="0" To="0.25" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="TitleText" d:IsOptimized="True"/>
    						<DoubleAnimation Duration="0" To="0.25" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="myAccount_Button" d:IsOptimized="True"/>
    						<DoubleAnimation Duration="0" To="0.25" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="customerServiceButton" d:IsOptimized="True"/>
    						<DoubleAnimation Duration="0" To="0.25" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="loginRegister_Button" d:IsOptimized="True"/>
    						<DoubleAnimation Duration="0" To="0.25" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="framework" d:IsOptimized="True"/>
    						<DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="logOut_Button" d:IsOptimized="True"/>
    					</Storyboard>
    				</VisualState>
    				<VisualState x:Name="UnModal"/>
    			</VisualStateGroup>
    			<VisualStateGroup x:Name="CustomerService">
    				<VisualState x:Name="ShowCustomerServiceDialog">
    					<Storyboard>
    						<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="customerServiceDialog" d:IsOptimized="True"/>
    					</Storyboard>
    				</VisualState>
    				<VisualState x:Name="HideCustomerServiceDialog"/>
    			</VisualStateGroup>
    		</VisualStateManager.VisualStateGroups>
    		<local:ModalBG d:IsPrototypingComposition="True"/>
    		<local:Framework x:Name="framework" d:IsPrototypingComposition="True"/>
    		<TextBlock x:Name="TitleText" HorizontalAlignment="Stretch" Margin="0,187,0,0" Style="{StaticResource TitleCenter-Sketch}" TextWrapping="Wrap" Text="Welcome" VerticalAlignment="Top"/>
    		<local:LoginRegister x:Name="LoginRegisterDialog" d:IsPrototypingComposition="True" Opacity="0"/>
    		<local:CustomerServiceDialog x:Name="customerServiceDialog" d:IsPrototypingComposition="True" Opacity="0"/>
    		<local:MyAccount_Button x:Name="myAccount_Button" HorizontalAlignment="Right" VerticalAlignment="Top" d:IsPrototypingComposition="True" Margin="0,76,40,0" IsEnabled="False"/>
    		<local:CustomerServiceButton x:Name="customerServiceButton" HorizontalAlignment="Right" VerticalAlignment="Top" d:IsPrototypingComposition="True" Margin="0,42,40,0" ToolTipService.ToolTip="Click for information on how to contact Customer Service.">
    			<i:Interaction.Triggers>
    				<i:EventTrigger EventName="MouseLeftButtonDown">
    					<!--Added TargetScreen while troubleshooting-->
    					<pi:ActivateStateAction TargetScreen="CactusTest1Screens.Welcome" TargetState="ModalBG"/>
    					<pi:ActivateStateAction TargetScreen="CactusTest1Screens.Welcome" TargetState="ShowCustomerServiceDialog"/>
    				</i:EventTrigger>
    			</i:Interaction.Triggers>
    		</local:CustomerServiceButton>
    		<local:LogOut_Button x:Name="logOut_Button" HorizontalAlignment="Right" VerticalAlignment="Top" d:IsPrototypingComposition="True" Margin="0,8,40,0"/>
    		<local:LoginRegister_Button x:Name="loginRegister_Button" HorizontalAlignment="Right" VerticalAlignment="Top" d:IsPrototypingComposition="True" Margin="0,8,40,0">
    			<i:Interaction.Triggers>
    				<i:EventTrigger EventName="MouseLeftButtonDown">
    					<pi:ActivateStateAction TargetState="ModalBG"/>
    				</i:EventTrigger>
    			</i:Interaction.Triggers>
    		</local:LoginRegister_Button>
    	</Grid>
    </UserControl>
    
    

     

    Wednesday, July 21, 2010 9:26 PM

All replies

  • One minor detail: I used two separate state groups (both of which manage non-overlapping elements) for the 2 states in question.
    Wednesday, July 21, 2010 9:49 PM
  • ttt- isn't this easy for someone out there? please help! thank you again.....
    Tuesday, July 27, 2010 10:26 PM