.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

How to Use Storyboard.SetTargetProperty in WPF? I think It's diffrent another animation...

Posted By:      Posted Date: October 06, 2010    Points: 0   Category :WPF

Hello, glad to see U

I have a question How to use the Storyborard.SetTargetProperty... I need some help : (


I made this code (view2 is Viewbox Control), It's a example



double w2 = 200;

double h2 = 200;

DoubleAnimation daW = new DoubleAnimation(w2, TimeSpan.FromMilliseconds(100)) { FillBehavior = FillBehavior.HoldEnd };

DoubleAnimation daH = new DoubleAnimation(h2, TimeSpan.FromMilliseconds(100)) { FillBehavior = FillBehavior.HoldEnd };

view2.BeginAnimation(Viewbox.WidthProperty, daW);

view2.BeginAnimation(Viewbox.HeightProperty, daH);




double tempX = -50;

double tempY = -80;

DoubleAnimation daX = new DoubleAnimation(tempX, TimeSpan.FromSeconds(0.1)) { FillBehavior = FillBehavior.HoldEnd };

DoubleAnimation daY = new DoubleAnimation(tempY, TimeSpan.FromSeconds(0.1)) { FillBehavior = FillBehavior.HoldEnd };

v2.RenderTransform.BeginAnimation(TranslateTransform.XProperty, daX);

v2.RenderTransform.BeginAnimation(TranslateTransform.YProperty, daY);



I want conbine all codes, so I made a st

View Complete Post

More Related Resource Links

Is this a BUG?(Storyboard + database search + Storyboard = badly delayed animation)(Cannot run a sto

//push a button play the first storyboard animation : ListView fade-out

private void image4_MouseDown(object sender, MouseButtonEventArgs e)


   Storyboard sb2 = (Storyboard)this.FindResource("daychange_Copy1") as Storyboard;

   sb2.Completed += new EventHandler(sb_Completed);



//when the first animation is end, get data from database , fill the ListView and play the second storyboard animation

void sb_Completed(object sender, EventArgs e)


   getlist();//get data from database , fill the ListView

   Storyboard sbkk = (Storyboard)this.FindResource("daychange_Copy2") as Storyboard;



//get data from database , fill the ListView

private void getlist()



Silverlight Simple Animation

Silverlight has several built in techniques for animating controls. Many of these technologies are particularly useful for creating simple animations meant to decorate a web page with eye catching movement that draws the reader's attention. In this post I will skip over these decorative technologies, and instead show how to create a simple animation using a technique similar to those used in many games.

Animation Extender ( LinkButton Disbale )


My flyout animation starts on a click of linkbutton, everything works fine on IE, as I click the linkbutton flyout animation is triggered and linkbutton gets disbaled during the animation. But on Firefox and Chorme linkbutton doesn't get disbaled , due which if I again and again click on the linkbutton the flyout animation keeps moving towards left side on every click.

In firefox and chorme linkbutton always remains enabled.

 <cc1:AnimationExtender ID="AnimationExtender1" TargetControlID="lnkBtnAbt" runat="server">
                        <EnableAction Enabled="false" />
                        <StyleAction AnimationTarget="moveMe" Attribute="display" Value="block"/>
                        <Parallel AnimationTarget="moveMe" Duration=".5" Fps="30">
                            <Move Horizontal="-350" Vertical="50"></Move>
                            <FadeIn Duration=".5"/>
                        <Parallel AnimationTarget="moveMe" Duration=".5">

Foundations: Extending the WPF Animation Classes


Learn what the WPF Animation Classes can do, what they can't, and how to extend them.

Charles Petzold

MSDN Magazine July 2007

DirectX 8.0: Enhancing Real-Time Character Animation with Matrix Palette Skinning and Vertex Shaders


DirectX 8.0 allows the creation of smooth and realistic character movements that are more life-like than simple articulated structure animations. This is made possible by its improved support for vertex tweening and blended vertex deformations, also known as soft-skinning. After a brief history of the use of these techniques in DirectX, soft-skinning using the fixed function pipeline is discussed. This is followed by the use of matrix palettes from within vertex shaders to create a customized soft-skinning solution that takes advantage of the benefits of vertex shaders, such as hardware acceleration and custom lighting algorithms without the limitations of fixed-function solutions.

Benjamin Freidlin

MSDN Magazine June 2001

review, edit and insert data using 2 diffrent database



is it possible to create a custom list in sharepoint designer to enter a vacation request and using a work flow that goes to the HR department. but when the HR department approve the request the HR can store these requested data into another database?

what i mean is, the employee fill a form in to request some vacation days using a custom list in my wss3 site. i assume that these data will be stored in the WSS_content database. now when the HR department get this filled form they have to store the data of the form in to a database but not in the WSS_Content database.

is this possible?

MVVM and Animation Control

I've been struggling with what should be a fairly straightforward issue...hoping someone's got a solution.I'm using MVVM in a scenario where I'm using a MediaElement in a View. The MediaElement has a Storyboard that I customize using DataBinding. The scenario works well when I'm using EventTriggers to control playback, but I have not discovered how to manipulate things using DataTriggers.My Storyboard consists of a ParallelTimeline, which contains the MediaTimeline (with Source, BeginTime and Duration databound to the ViewModel. I've got two buttons that are attached to the Storyboard in EventTriggers calling PauseStoryboard and ResumeStoryboard. This works well, but it's not the best paradigm for me.I am trying to accomplish a design where, if I have two such Views each containing a MediaElement with this type of Storyboard, when one Storyboard reaches its end point, the other View's MediaElement is triggered to play.I have tried to use a DataTrigger design, but I am having problems freezing the Storyboard because I'm using DataBinding to set some of the Storyboard parameters.Does anyone have any ideas as to how I can control a MediaElement via Storyboard/Timeline using DataTrigger instead of EventTrigger? Am I missing something obvious in MVVM?--- Jim ---

animation ajax control

hi , how I do like this http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/Animation/Animation.aspx the first exemple

StopStoryboard fails to stop an animation

I have a textbox style that sets the Template property in order to add an animated watermark: <Style TargetType="{x:Type TextBox}">     <Setter Property="Template">         <Setter.Value>             <ControlTemplate TargetType="{x:Type TextBox}">                 <Border BorderBrush="{TemplateBinding BorderBrush}"                         BorderThickness="{TemplateBinding BorderThickness}"                         Padding="{TemplateBinding Padding}">                     <Grid>                         <AdornerDecorator Name="PART_ContentHost" />                   &

How to I apply an XAML declared animation to multiple controls dynamically?

Hello, How to I apply an XAML declared animation to multiple controls dynamically? Here is the XAML declared animation: <Window.Resources> <Storyboard x:Key="TextBlock_SB"> <DoubleAnimation Storyboard.TargetName="TextBlock_1" Storyboard.TargetProperty="(TextBlock.Opacity)" From="1.0" To="0.75" Duration="0:0:0.5" AutoReverse="True" RepeatBehavior="Forever" /> </Storyboard> Here is the code that starts the animation for TextBlock_1: (this.Resources["TextBlock_SB"] as Storyboard).Begin(); I want to apply the same storyboard/animation to TextBlock_2 and TextBlock_3 and perhaps others.  How do I do that without defining more XAML storyboards? Regards, Robert  

Update progress animation

I have an update progress control that I use to overlay an updatepanel. It has an animated gif that is displayed. The animated gif doesn't not work though unless I add system.threading.thread.sleep([seconds]) . Obviously I don't want to do that. Is there something I need to do to get the gif to work or is it just the nature of the beast? Here is the code for the update progress. It is triggered by an update panel that has a control that updates another update panel. <asp:UpdateProgress id="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel2" DisplayAfter="1"> <progresstemplate> <DIV class="LoadingOverlay"></DIV> <DIV class="LoadingMessage">Loading...<BR /><IMG src="../../../helpdesk/img/progress.gif" /> </DIV> </progresstemplate> </asp:UpdateProgress>  

play storyboard with dynamically created image

this is my storyboard:   <Storyboard x:Key="expandStoryboard"> <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="2" Duration="0:0:0.2" /> <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="2" Duration="0:0:0.2" /> </Storyboard> <!-- This storyboard will make the image revert to its original size --> <Storyboard x:Key="shrinkStoryboard"> <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="0:0:0.2" /> <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="0:0:0.2" /> </Storyboard>   and i created image dynamically:   BitmapImage bmp = new BitmapImage(); bmp.BeginInit(); bmp.UriSource = new Uri("file:///" + arrstrFileNames[0].Replace("\\", "/")); bmp.EndInit(); Image img = new Image(); img.Source = bmp; RotateTransform rt = new RotateTransform(); img.LayoutTransform = rt; ScaleTransform st = new ScaleTransform(); st.ScaleX = 1; st.ScaleY = 1; img.LayoutTransform = st; if(first==true) img.ContextMenu = mnu; first = false; assignEv

VisualStateManager: change a property before it starts animation?

i realize that if we "animate" the Visibility property.. it uses the ObjectAnimationUsingKeyFrames animation to set the property after it transits to a new state... how can i change the property before it animates in the new state? i know there is the CurrentStateChanged and CurrentStateChanging event that i can use to set the property.. however... that is ok if you have 2 states.. but for my case i have a couple of states(in my case 7 states)... so if change the visibility in one of the states... the property doesn't switch back automatically when we switched to another state.... my thought of having 7 conditions to change the property just isn't the right way of doing... maybe.... it would be good if the VisualStateManager provides an attachedproperty to set on the specific ObjectAnimationUsingKeyframes to indicate whether the animation property is to be set at the start or at the end of the animation thanks

Animation on the button click event???

hi, I have prepared a wpf application with 3 buttons. namely: start configure and manual now i want when initially the form loads the only start button should be visible. well not a big task at all!!! i have done it   but:   now i want to make the other two buttons visible and the start button invisible with a bit of animation on the button click event associated with "start" button.   Can any one plz suggest how should i proceed on with??? And ya am using c# for programming the application.....

Can animation extender be used to replicate Twitter's smooth-scrolling, latest-tweet control?

I'm not going for the exact same control, but if I can find a smart way to automatically/smoothly scroll through text from the database on Timer Tick intervals of 5 seconds... then I can use that as a template. My main idea would be to just dynamically create panels with the text inside of them, then dispose of them when they come towards the bottom of the list... but 3 things stop me 1) it would be a lot of work, 2) when the last panel cycles to the bottom of the display area then how do I make it smoothly disappear? 3) What would I use for the display spot?- a Panel won't work because if its contents exceed the set height, it either just expands to fit it or adds scroll bars. I basically want it to have slideshow functionallity how the images smoothly scroll every few seconds (without the scroll bar), and instead of images I want to use text. Any ideas?

Report Loading animation

Hi all, Is it possible to change the report loading green doughnut to be another animated graphic?  If so how? Thanks! Ash

Colapsable Panel Animation

 Hello, Someone knows a way to block/disable the Animation of ColapsablePanel on Colapse/Expand? I am having problems of performance/stucks of the page on colapse or expand a panel. Thanks!
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend