Fody is an extensible tool for weaving .NET assemblies. For more information about Fody, see its official website.
To enable Catel.Fody to weave assemblies, you need to perform the following steps:
- Install the Catel.Fody NuGet package
- Update FodyWeavers.xml and make sure it contains <Catel />
Note that the FodyWeavers.xml should be updated automatically when you install the package
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:
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.
|WeaveProperties||true||Weave all regular properties on classes that inherit (directly or indirectly) from Catel.Data.ModelBase into Catel properties.|
|WeaveExposedProperties||true||Weave all Catel properties decorated with both the Catel.MVVM.Model attribute and Fody.Expose attribute as automatic mappings.|
|WeaveArguments||true||Weave all Argument check attributes into actual argument checks.|
|WeaveLogging||true||Weave all calls to LogManager.GetCurrentClassLogger() into LogManager.GetLogger(typeof(classname)).|
|GenerateXmlSchemas||false||Generate 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: