This is a migrated thread and some comments may be shown as answers.

Almost: label slide animation with easing and fade on completion

2 Answers 115 Views
TransitionControl
This is a migrated thread and some comments may be shown as answers.
Edward
Top achievements
Rank 2
Edward asked on 17 Jul 2012, 05:49 PM
Hi, 

I have a nice simple working example of a label wrapped with a RadTransistion control. It is for use in a notification area - I try to mimick the WebOS notification system :-) . The slide animation is working and I get a nice fast slide in.

The only things I have problems with and where I hope you can help is:

- setting a foreground color of the label (sometime it's red, sometimes it's green)

- easing out the last 40-50 pixels

- after 3 seconds of completion, the content of the label should fade away (in 0.5 sec)


<telerik:RadTransitionControl x:Name="lblNotificationRight" Content="" HorizontalAlignment="Center" Duration="00:00:01"  >
 
              <telerik:RadTransitionControl.ContentTemplate>
                  <DataTemplate>
                      <telerik:Label Content="{Binding}" HorizontalAlignment="Right" VerticalAlignment="Center" Foreground="WhiteSmoke" FontSize="14"/>
                  </DataTemplate>
              </telerik:RadTransitionControl.ContentTemplate>
               
              <telerik:RadTransitionControl.Easing>
                  <BackEase />
              </telerik:RadTransitionControl.Easing>
               
              <telerik:RadTransitionControl.Transition>
                  <telerik:SlideAndZoomTransition MinZoom="1.0" SlideDirection="RightToLeft" />
              </telerik:RadTransitionControl.Transition>
          </telerik:RadTransitionControl>


In the code behind:

private void DoStandardNotification(StandardNotificationItem pStandardNotificationItem)
{
lblNotificationRight.Background = pStandardNotificationItem.BackgroundColor;
lblNotificationRight.Foreground = pStandardNotificationItem.ForegroundColor;
lblNotificationRight.Content = pStandardNotificationItem.Message;
}




Sincerely,

Edward

2 Answers, 1 is accepted

Sort by
0
Accepted
Rosen Vladimirov
Telerik team
answered on 19 Jul 2012, 01:15 PM
Hello,

You can use the TransitionStatusChanged event to check if the TransitionStatus is completed or not. Refer to our online help for more details: http://www.telerik.com/help/wpf/radtransition-events-overview.html 
To implement the fade away effect of the content of the label you can set the TransitionControl.Content to null to clear the TranistionControl area. To be more clear we have created a sample project for you, please find it attached. In it we have set the foreground of the content to be red or green as you described.
Hopefully this will help you to resolve the issues.

Best regards,
Rosen Vladimirov
the Telerik team
0
Edward
Top achievements
Rank 2
answered on 27 Jul 2012, 04:03 PM
Super!
Tags
TransitionControl
Asked by
Edward
Top achievements
Rank 2
Answers by
Rosen Vladimirov
Telerik team
Edward
Top achievements
Rank 2
Share this question
or