Click here to Skip to main content
15,896,912 members
Home / Discussions / C#
   

C#

 
GeneralForm closing issue Pin
Neo Andreson31-Jan-08 19:51
Neo Andreson31-Jan-08 19:51 
GeneralRe: Form closing issue Pin
stancrm31-Jan-08 20:06
stancrm31-Jan-08 20:06 
AnswerRe: Form closing issue Pin
Vikram A Punathambekar31-Jan-08 20:08
Vikram A Punathambekar31-Jan-08 20:08 
GeneralProblem in Getting MAC Address of a Remote machine... Pin
Balagurunathan S31-Jan-08 19:49
Balagurunathan S31-Jan-08 19:49 
GeneralWPF: Object position does not change. Pin
AghaKhan31-Jan-08 11:58
AghaKhan31-Jan-08 11:58 
GeneralRe: WPF: Object position does not change. Pin
CKnig31-Jan-08 18:52
CKnig31-Jan-08 18:52 
GeneralRe: WPF: Object position does not change. Pin
AghaKhan1-Feb-08 7:24
AghaKhan1-Feb-08 7:24 
GeneralRe: WPF: Object position does not change. Pin
CKnig1-Feb-08 21:34
CKnig1-Feb-08 21:34 
If you are using a storyboard instead of BeginAnimation directly you can handle a event - telling you when the stroyboard finishs - there you just save the old value in a local variable, set the storyboard/animations of the element to null and reassign the value to the property - that's it.

This works because:
- the properties are reflecting the values assinged by the storyboards progress but you can't set them because the storyboard will override them
- by setting a null storyboard to a element you will erase all existing storyboards
- after this you can use the properties just like you used to

Here is an example using AxisAngleRotations, this code runs in a Completed-event of a storyboard rotating some WPF-3D elements:

<br />
// remember the values:<br />
int iSign = Math.Sign((I.currRotation.Rotation as AxisAngleRotation3D).Angle);<br />
var dAngle = Math.Ceiling(Math.Abs((I.currRotation.Rotation as <br />
                   AxisAngleRotation3D).Angle / 90.0)) * 90.0 * iSign;<br />
<br />
// cancel the rotation-animation<br />
I.currRotation.Rotation.BeginAnimation(AxisAngleRotation3D.AngleProperty, null);<br />
<br />
//reset the values<br />
if ((I.currRotation.Rotation as AxisAngleRotation3D).Angle != dAngle)<br />
       (I.currRotation.Rotation as AxisAngleRotation3D).Angle = dAngle;<br />


(you might wonder why I use the ugly "/ 90 ) * 90" ... construct! - Well this code is for a "rubiks cube" and there I only want the finished rotations to be multiples of 90°. But if you use many rotations you might end up at 89.8 or something and this just looks weired)
GeneralVb to C# Pin
NewToAspDotNet31-Jan-08 11:39
NewToAspDotNet31-Jan-08 11:39 
GeneralRe: Vb to C# [modified] Pin
MarkB77731-Jan-08 12:33
MarkB77731-Jan-08 12:33 
GeneralRe: Vb to C# Pin
Guffa31-Jan-08 12:41
Guffa31-Jan-08 12:41 
GeneralRe: Vb to C# Pin
DaveyM6931-Jan-08 13:30
professionalDaveyM6931-Jan-08 13:30 
GeneralRe: Vb to C# Pin
Vikram A Punathambekar31-Jan-08 17:59
Vikram A Punathambekar31-Jan-08 17:59 
GeneralRe: Vb to C# Pin
DaveyM6931-Jan-08 20:55
professionalDaveyM6931-Jan-08 20:55 
GeneralRe: Vb to C# Pin
Guffa31-Jan-08 21:41
Guffa31-Jan-08 21:41 
GeneralRe: Vb to C# Pin
Guffa31-Jan-08 21:56
Guffa31-Jan-08 21:56 
GeneralRe: Vb to C# Pin
Vikram A Punathambekar1-Feb-08 1:47
Vikram A Punathambekar1-Feb-08 1:47 
GeneralRe: Vb to C# Pin
Pete O'Hanlon1-Feb-08 3:39
mvePete O'Hanlon1-Feb-08 3:39 
GeneralRe: Vb to C# Pin
Guffa1-Feb-08 5:11
Guffa1-Feb-08 5:11 
JokeRe: Vb to C# Pin
DavidNohejl1-Feb-08 6:17
DavidNohejl1-Feb-08 6:17 
GeneralRe: Vb to C# Pin
Guffa1-Feb-08 5:16
Guffa1-Feb-08 5:16 
Questionhow to call DLL function in generic method? Pin
vicky45731-Jan-08 9:32
vicky45731-Jan-08 9:32 
AnswerRe: how to call DLL function in generic method? Pin
S. Senthil Kumar1-Feb-08 6:02
S. Senthil Kumar1-Feb-08 6:02 
GeneralRe: how to call DLL function in generic method? Pin
vicky4571-Feb-08 6:58
vicky4571-Feb-08 6:58 
QuestionHow to assign DataView to Datatable Pin
ss.mmm31-Jan-08 9:27
ss.mmm31-Jan-08 9:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.