In the section "Using Type Visibility and Member Accessibility Intelligently" of the modern classic CLR via C# (pages 169-172), Jeffrey Richter discusses why he believes that most classes should be defined as sealed. The Microsoft developers behind the System.Windows.Media.Media3D namespace seem to agree: In this namespace, every class is either abstract or sealed with just one exception: ModelVisual3D . This architecture creates challenges for the programmer wishing to write classes that generate triangle meshes algorithmically. The most straightforward approach would be deriving from MeshGeometry3D but you just can't do it. As I discuss in Chapter 6 of my new book 3D Programming for Windows , you have two good alternatives that let you reference your mesh-generation classes in XAML: Write a class that has a public property of type MeshGeometry3D . Instantiate this class as a resource in a XAML file. Define a binding between the property of this resource and the Geometry property of a
Read More...