mirror of
https://github.com/Stone-Red-Code/docs-desktop.git
synced 2026-09-04 09:06:04 +02:00
* Reset branch for WPF changes * Convert BMP to PNG; fix link-out-of-scope err * Add snippets for WPF... 6794 files!!!! * Add missing snippets * update file updated between migration * Fix paths to include * update breadcrumb and toc * fix index links * fix index links * fix index links * fix markdown
1.3 KiB
1.3 KiB
title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
| title | ms.date | dev_langs | helpviewer_keywords | ms.assetid | |||||
|---|---|---|---|---|---|---|---|---|---|
| How to: Hit Test in a Viewport3D | 03/30/2017 |
|
|
42bfbd99-c7c6-43f1-940b-90448faa412e |
How to: Hit Test in a Viewport3D
This example shows how to hit test for 3D Visuals in a xref:System.Windows.Controls.Viewport3D.
Because xref:System.Windows.Media.VisualTreeHelper.HitTest%2A returns 2D and 3D information, it is possible to iterate through the test results to read only 3D results.
[!code-csharpHitTest3D#HitTest3D3DN4] [!code-vbHitTest3D#HitTest3D3DN4]
The xref:System.Windows.Media.HitTestResultBehavior in the following code determines how the hit test results are processed. UpdateResultInfo and UpdateMaterial are locally defined methods.
[!code-csharpHitTest3D#HitTest3D3DN5] [!code-vbHitTest3D#HitTest3D3DN5]