Files
docs-desktop/dotnet-desktop-guide/framework/wpf/graphics-multimedia/how-to-hit-test-in-a-viewport3d.md
T
Andy De George da363692ff Initial WPF content migrated (#17)
* 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
2020-09-04 09:46:28 -07:00

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
csharp
vb
3D visuals [WPF], hit-testing for
hit tests [WPF], for 3D visuals
Viewport3D [WPF]
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]