# .NET and More > WPF, WCF, WF >  HELP: Rotate Line constant WPF

## VBEdw

Hello,
I do not fail to rotate that line consistently,
ie not jumping out six in 6 degrees tick,
I need to rotate fluently,
Angle="{Binding SecAngle}" its update to second.
This is for Analog Clock.
I'm a beginner  :Smilie: 


```
    <Grid>
        <Line Stroke="Blue" StrokeThickness="10" VerticalAlignment="Center" HorizontalAlignment="Center" X1="5" X2="5" Y1="0" Y2="-175" RenderTransformOrigin="0.5,0.5">
            <Line.RenderTransform>
                <TransformGroup>
                    <ScaleTransform/>
                    <SkewTransform/>
                    <RotateTransform Angle="{Binding SecAngle}"/>
                </TransformGroup>
            </Line.RenderTransform>
        </Line>
   </Grid>
```

I do not want to use this From="0" To="360" Duration="0:1:0" I want to be in real time

----------


## passel

Perhaps the rotation should be done in backing code, rather than tied through xaml.

----------


## VBEdw

Ok, but how can you do?

----------


## passel

Perhaps I misunderstood the question.
Rereading it I thing you are saying that the hand does move in one second increments (i.e. six degrees at a time).
But you want it to move smoothly, in one degree increments, rather than six degree increments, but still in sync with real time of day.

How are you setting secAngle?
Are you setting it like,
secAngle = Now.Second * 6
periodically in a timer?

Perhaps set it to
secAngle = (Now.Second * 6) + (Now.Millisecond * 0.006)

----------


## VBEdw

Hi Passel,
time interval is TimeSpan.FromMilliseconds(1)
and SecAngle = ((DateTime.Now.Second * 1000) + DateTime.Now.Millisecond) * (360 / 60000)
this work, but is not fluently .
I need to move like this: https://youtu.be/ttDj1AvyhHQ

Thank you in advance Passel .

----------


## passel

I haven't really done any WPF, just looked at it a bit, so don't know all the mechanics behind how it updates the window in the various drawing type scenarios.
For instance, at what rate do you update SecAngle?  Is it faster than 6 times a second, perhaps 18 times a second would be a good choice.
But even if you update it 18 times a second, since the connection to the value is Binding done in XAML, what does that mean for the window update. Perhaps the framework is designed to update the GUI (check all the binding values) at 4hz, and do any drawing necessary, so it doesn't matter how quickly you change the value, the display will only update at a fixed rate by default.

I'm not saying that is the case since I'm really not familiar with the underpinnings of WPF at all, and perhaps there is a "refresh" type method that can force the display to redraw more often, but since I don't know WPF, I guess I'm going to have to bow out.
I don't have the time to try to start learning WPF anytime soon.

Sitten Spynne has worked with WPF quite a bit, and would definitely be a better sounding board than I am, but he has been moving away from WPF into other areas, so may be ignoring this thread as it is outside of a subject he currently wants to get involved in, or perhaps has just missed it.
Using the built in animation would of course be the smoothest since it is designed for that, and should be synchronized with the vertical sync, and be stable, but getting the animation synchronized with an external input is probably problematic. It would seem that there are approaches where you could use the animation feature, but manipulate another value and tie one animation you see with perhaps the builtin animation you don't see, but since I don't know WPF, I can't even begin to test any theories.

Good luck.

----------

