1. Windows Phone 7 中的行為(行為、觸發器、動作統稱為行為)
基類 |
用法 |
Behavior < T > |
This is the simplest form of behavior in that it only exposes OnAttached and OnDetaching methods that you can override. You'd typically use these to wire up event handlers to the AssociatedObject (the XAML element that the behavior is attached to). |
TriggerAction < T > |
One of the most common forms of behavior is the invocation of an action in response to an event. For example, you might want to navigate to a page when the user clicks a button. A TriggerAction allows the designer to specify which event on the associated control the behavior should observe. It then calls the overrideable Invoke method whenever the event triggers. |
TargettedTriggerAction < T > |
The last form of behavior is an extension of the TriggerAction that allows the designer to specify the target element. Within the Invoke method you can reference the Target element, which may not be the same element that the behavior is attached to. |
2. Windows Phone 7 中的Orientation的枚舉值
可以看到橫排、豎排等的值,你會很奇怪,怎麼數字這麼沒有規律,我們來看下這些數字 對應的二進位值