TAILIEUCHUNG - Apress pro Silverlight 3 in C# phần 8

SilverLight như một đối thủ nặng ký của Adobe Flash, ra đời sau, thừa hưởng tính ưu việt của các công nghệ hiện có, nhỏ gọn, (sẽ) đa nền tảng, bộ công cụ phát triển mạnh mẽ và hoàn chỉnh, và hơn hết là được phát triển bởi Microsoft - ông trùm số một trong thế giới phần mềm | CHAPTER 13 TEMPLATES AND CUSTOM CONTROLS which is in the FocusStates group . If you do the result will depend on the order that the control applies its states. For example if the button applies the state from the FocusStates group first and then the state from the CommonStates group your focused state animation will be active for just a split second before being replaced by the competing MouseOver state. Figure 13-5. Focus in a custom button template Transitions The button shown in the previous example uses zero-length state animations. As a result the color change happens instantly when the mouse moves over the button. You can lengthen the duration to create a more gradual color blending effect. Here s an example that fades in the new color over a snappy seconds VisualStateGroup x Name CommonStates VisualState x Name MouseOver Storyboard ColorAnimation Duration 0 0 . Storyboard VisualState . VisualStateGroup Although this works the concept isn t quite right. Technically each visual state is meant to represent the appearance of the control while it s in that state not including the transition used to get into that state . Ideally a visual state animation should be either a zerolength animation like the ones shown earlier or a steady-state animation an animation that repeats itself one or more times. For example a button that glimmers when you move the mouse over it uses a steady-state animation. If you want an animated effect to signal when the control switches from one state to another you should use a transition instead. A transition is an animation that starts from the current state and ends at the new state. One of the advantages of the transition model is that you don t need to create the storyboard for this animation. Instead Silverlight creates the animation you need automatically. 464 CHAPTER 13 TEMPLATES AND CUSTOM CONTROLS Note Controls are smart enough to skip transition .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.