Fuse Community

WhileTrue animation not working

I have created Material Design Toast base on tutorials. But the animation part not working as expected. What’s wrong in my approach.

<Panel ux:Class="Toast" Layer="Overlay">
	<string ux:Property="Text" />
    <bool ux:Property="Visible" />
       <WhileTrue Value="{ReadProperty Visible}">
         <ActivatingAnimation>
            <DropShadow/>
            <BringToFront Target="btn"/>
            <Change btn.Visibility="Visible" Delay="0" DelayBack="0.26" />
            <Change btn.Opacity="0.6" Duration="0.36" />   
         </ActivatingAnimation>   
	    </WhileTrue>
	    <Rectangle ux:Name="btn"  Visibility="Collapsed" Opacity="0"  Height="36" CornerRadius="20" Color="#323232" Padding="16,0" Margin="16">
			<Text Value="{Property this.Text}" Font="RobotoRegular" Color="#FFFFFF" FontSize="14"  Alignment="CenterLeft"/>
		</Rectangle> 
</Panel>

And to call Toast component

<Toast Text="Error: Please fill all fields" Visible="{isError}"  Alignment="Center" ux:Name="toastError">
				</Toast>

Hey.

Your component looks great, but ActivatingAnimation is used to animate page when a specific page gets active and visible. Also, I would suggest using Shadow over DropShadow. Shadow class is known as a better solution. I think shadow belongs to rectangle so I moved it inside the rectangle.
Here is modified code:

<Panel ux:Class="Toast" Layer="Overlay">
	<string ux:Property="Text" />
    <bool ux:Property="Visible" />
       <WhileTrue Value="{ReadProperty Visible}">
            <BringToFront Target="btn"/>
            <Change btn.Visibility="Visible" Delay="0" DelayBack="0.26" />
            <Change btn.Opacity="0.6" Duration="0.36" />   
	    </WhileTrue>
	    <Rectangle ux:Name="btn"  Visibility="Collapsed" Opacity="0"  Height="36" CornerRadius="20" Color="#323232" Padding="16,0" Margin="16">
            <Shadow Size="10"/>
			<Text Value="{Property this.Text}" Font="RobotoRegular" Color="#FFFFFF" FontSize="14"  Alignment="CenterLeft"/>
		</Rectangle> 
</Panel>

Hope this helps.

Thank You Arturs! You have saved my day.

Does foreign code support swift lang now?

I dont see any tutorials on that!

Yes, it does (kind of), and here’s the docs. No tutorials I’m afraid, but that link should get you started.

Hey Uldis,

Thanks for the info! It seems hack at the moment. somewhere in forum i read that swift will be supported in future release.
I hope it will be out soon!

Best Regards,
Satz