HitTestResultBehavior Enum
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Determines whether to continue the enumeration of any remaining visual objects during a hit test.
public enum class HitTestResultBehavior
public enum HitTestResultBehavior
type HitTestResultBehavior =
Public Enum HitTestResultBehavior
- Inheritance
Name | Value | Description |
---|---|---|
Stop | 0 | Stop any further hit testing and return from the callback. |
Continue | 1 | Continue hit testing against the next visual in the visual tree hierarchy. |
The following example shows how to return a HitTestResultBehavior
value from a hit test results callback method.
// Return the result of the hit test to the callback.
public HitTestResultBehavior MyHitTestResult(HitTestResult result)
{
// Add the hit test result to the list that will be processed after the enumeration.
hitResultsList.Add(result.VisualHit);
// Set the behavior to return visuals at all z-order levels.
return HitTestResultBehavior.Continue;
}
' Return the result of the hit test to the callback.
Public Function MyHitTestResult(ByVal result As HitTestResult) As HitTestResultBehavior
' Add the hit test result to the list that will be processed after the enumeration.
hitResultsList.Add(result.VisualHit)
' Set the behavior to return visuals at all z-order levels.
Return HitTestResultBehavior.Continue
End Function
A hit test results callback method defines the actions that you perform when a hit test is identified on a particular visual object in the visual tree. After you perform the actions, you return a HitTestResultBehavior
value that determines whether to continue the enumeration of any other visual objects.
You can enumerate all visual objects in a visual tree whose geometry contains a specified coordinate value. By returning Continue
in your hit test callback method, you can identify all visual objects that are hit, even those that may be partly or wholly obscured by other visual objects.
Prodotto | Versioni |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
Feedback su .NET
.NET è un progetto di open source. Selezionare un collegamento per fornire feedback: