Fody is an extensible tool for weaving .NET assemblies. For more information about Fody, see its official website

Enabling Catel.Fody

To enable Catel.Fody to weave assemblies, you need to perform the following steps:

Note that the FodyWeavers.xml should be updated automatically when you install the package

Available functionality

Below are the several options available in Catel.Fody:

Disabling weaving for specific types or properties

To disable the weaving of types or properties of a type, decorate it with the NoWeaving attribute as shown in the example below:

[NoWeaving]
public class MyClass : ModelBase
{
    ...
}

Configuring Catel.Fody

Though we recommend to leave the default settings (great for most people), it is possible to configure the weaver. Below is a list of options that can be configured.

PropertyDefault valueDescription
WeavePropertiestrueWeave all regular properties on classes that inherit (directly or indirectly) from Catel.Data.ModelBase into Catel properties.
WeaveExposedPropertiestrueWeave all Catel properties decorated with both the Catel.MVVM.Model attribute and Fody.Expose attribute as automatic mappings.
WeaveArgumentstrueWeave all Argument check attributes into actual argument checks.
WeaveLoggingtrueWeave all calls to LogManager.GetCurrentClassLogger() into LogManager.GetLogger(typeof(classname)).
GenerateXmlSchemasfalseGenerate xml schemas for all classes that inherit (directly or indirectly) from Catel.Data.ModelBase.

To configure an option, modify FodyWeavers.xml by adding the property and value to the Catel element. For example, the example below will disable argument and logging weaving:

<Catel WeaveArguments="false" WeaveLogging="false" />