In some cases, you may need to prevent components from being discovered as part of a directory. For example, a part may be a base class from which it should be inherited rather than used. You can achieve this in two ways. First, you can use the abstract keyword for the component class. Abstract classes can provide inherited export to classes derived from abstract classes, but they are not provided for export.
If you cannot make a class an abstract class, you can use the partnotdiscoverable feature to modify it. Components modified with this feature will not be included in any directory. The following example demonstrates these modes. Dataone will be found in the directory. Since datatwo is abstract, it will not be discovered. Datathree uses the partnotdiscoverable feature, so it will not be discovered.
Code segment
[Export] public class dataone {// This part will be discovered // as normal by the catalog .} [Export] public abstract class datatwo {// This part will not be discovered // By the catalog .} [partnotdiscoverable] [Export] public class datathree {// This part will also not be discovered // By the catalog .}