Make complex list options in WP7 vivid

Source: Internet
Author: User

In WP7 projects, we often use someComplex list optionsThey are usually used to present a small amount of information and play a navigation role, such as the following figure:

650) this. width = 650; "style =" width: 251px; height: pixel PX "border =" 0 "alt =" "src =" http://www.bkjia.com/uploads/allimg/131228/1P9354206-0.png "width =" 324 "height =" 639 "/>

The two-color ball, 3D and colorful are used for navigation, but the picture on the left has a title and the descriptions below. They constitute a complex list option, which is used for navigation. According to the user experience, if this list is not changed when we click, the user experience will be relatively poor. If a change can be added, the user can experience the successful click. In WP7, the usually added change is the dip change. For example, the complex list is divided into four parts. When a click occurs within 1 range, the area is tilted in 1. 4.

650) this. width = 650; "border =" 0 "alt =" "src =" http://www.bkjia.com/uploads/allimg/131228/1P9355915-1.jpg "/>

In Silverlight, there is a class that represents three-dimensional effects: PlaneProjection. You can change the RotationY and RotationX attributes to change the plane angle. You can place images, titles, and descriptions in a container control to change the Projection attribute of the container control to achieve the changed effect. The Code is as follows:
 
 
  1. PlaneProjection pp = new PlaneProjection();  
  2. pp.RotationY = 10;  
  3. pp.RotationX=10;  
  4. StackPanel sp = new StackPanel();  
  5. sp.Projection = pp; 
There is another question: when to trigger tilting. The container control has three events: ManipulationStarted, ManipulationDelta, and ManipulationCompleted. They are changed when the gesture is input, triggered at the end, that is, when we click, click not to move, click the trigger after leaving. These three events are used to change the skew of the Container Control. The complete code is as follows:
 
 
  1. Private void StackPanel_ManipulationStarted (object sender, ManipulationStartedEventArgs e)
  2. {
  3. // Tilt display Animation
  4. PlaneProjection pp = new PlaneProjection ();
  5. StackPanel sp = (sender as StackPanel );
  6. If (e. ManipulationOrigin. x> 100)
  7. {
  8. Pp. RotationY =-20;
  9. }
  10. Else
  11. {
  12. Pp. RotationY = 20;
  13. }
  14. If (e. ManipulationOrigin. Y> 28)
  15. {
  16. Pp. RotationX = 20;
  17. }
  18. Else
  19. {
  20. Pp. RotationX =-20;
  21. }
  22. Sp. Projection = pp;
  23. }
  24. Int value = 16;
  25. Private void StackPanel_ManipulationDelta (object sender, ManipulationDeltaEventArgs e)
  26. {
  27. // Tilt display Animation
  28. PlaneProjection pp = new PlaneProjection ();
  29. StackPanel sp = (sender as StackPanel );
  30. If (e. ManipulationOrigin. x> 100)
  31. {
  32. Pp. RotationY =-20;
  33. }
  34. Else
  35. {
  36. Pp. RotationY = 20;
  37. }
  38. If (e. ManipulationOrigin. Y> 28)
  39. {
  40. Pp. RotationX = 20;
  41. }
  42. Else
  43. {
  44. Pp. RotationX =-20;
  45. }
  46. Sp. Projection = pp;
  47. }
  48. Private void StackPanel_ManipulationCompleted (object sender, ManipulationCompletedEventArgs e)
  49. {
  50. // Restore tilt display Animation
  51. PlaneProjection pp = new PlaneProjection ();
  52. StackPanel sp = (sender as StackPanel );
  53. Pp. RotationY = 0;
  54. Pp. RotationX = 0;
  55. Sp. Projection = pp;
  56. }
When you click the complex list option again, the system will not respond.

This article is from "Gui Su Wei" blog, please be sure to keep this source http://axzxs.blog.51cto.com/730810/786848

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.