July 2007
Intermediate to advanced
448 pages
13h 39m
English
You can't derive a class from MeshGeometry3D, but all is not lost. Instead, you can define a mesh-generation class to be used as a resource in XAML files, and then refer to that resource in your markup with a data binding.
Here's a mesh-generation class that doesn't explicitly inherit from anything:
namespace MyMeshGeometryLibrary
{
public class SphereMeshGenerator
{
...
public MeshGeometry3D Geometry
{
get { ... }
}
...
}
}This SphereMeshGenerator class probably has several properties named Slices, Stacks, Radius, and Center, but it also has a get-only property of type MeshGeometry3D that I've named Geometry. The get-accessor of this Geometry property creates a new MeshGeometry3D, fills all four collections, ...
Read now
Unlock full access