Today, I want to share with you the three-dimensional interface that I just created and can be rotated. I don't want to introduce it too much. Let's take a look at the following pictures.
In factProgramThe window becomes transparent, so you can make an animation of the login interface of QQ 2013.
After running this example, the left and right arrows on the keyboard are used to control the rotation direction.
I used the keybinding class to set the shortcut keys here. In addition, I customized two commands to execute the animation of turning left and right respectively.
/// <Summary> /// move forward /// </Summary> public class forwcommand: icommand {public bool canexecute (object parameter) {If (parameter = NULL) {return false;} return true;} public event eventhandler canexecutechanged; Public void execute (object parameter) {parameter rot = parameter as axisanglerotation3d; doubleanimation d = new doubleanimation (); D. duration = new duration (timespan. frommilliseconds (800); D. by = 90d; rot. beginanimation (axisanglerotation3d. angleproperty, D, handoffbehavior. compose) ;}/// <summary> /// move backward // </Summary> public class backcommand: icommand {public bool canexecute (object parameter) {If (parameter = NULL) {return false;} return true;} public event eventhandler canexecutechanged; Public void execute (object parameter) {axisanglerotation3d rot = parameter as axisanglerotation3d; doubleanimation d = new doubleanimation (); D. by =-90d; D. duration = new duration (timespan. frommilliseconds (800); rot. beginanimation (axisanglerotation3d. angleproperty, D, handoffbehavior. compose );}}
Then apply it to the main window class.
// Set the shortcut key keybinding forwbind = new system. windows. input. keybinding (); forwbind. command = new forwcommand (); forwbind. commandparameter = Ar; forwbind. key = system. windows. input. key. right; this. inputbindings. add (forwbind); keybinding backbind = new system. windows. input. keybinding (); backbind. command = new backcommand (); backbind. commandparameter = Ar; backbind. key = system. windows. input. key. left; this. inputbindings. add (backbind );
For the UI, referSource codeMainly uses 3D materials.
LaterCodeUpload to the resource area.