Updated code snippets

After releasing Catel 5, we thought it was a good time to update the code snippets. It’s been a while since we’ve touched them and we got some great feedback. Some of a code snippets will be unnecessary when using Catel.Fody, but can be extremely useful for developers that don’t use Catel.Fody.

Catel 5 has the following code snippets available:

  • log – Create a log for a class
  • model – A simple ModelBase implementation
  • modelprop – A property registration for a ModelBase class
  • modelpropchanged – A property registration with change callback for a ModelBase class
  • vm – A simple ViewModelBase implementation
  • vmcommand – A command to use inside a view model
  • vmcommandwithcanexecute – A command with CanExecute handler to evaluate execution state
  • vmprop – A property registration for a ViewModelBase class
  • vmpropchanged – A property registration with change callback for a
    ViewModelBase class
  • vmpropmodel – A property registration for a property that represents a
    model for ViewModelBase
  • vmpropviewmodeltomodel – A property registration with ViewModelToModel mappings for a ViewModelBase class
  • vmtaskcommand – A task command to use inside a view model
  • vmtaskcommandwithcanexecute – A task command with CanExecute handler to evaluate execution state

We made a few generic improvements:

  • Removed xml documentation and regions to prevent pollution so they can be added manually if needed
  • Use nameof() instead of strings in property registrations

You can download the code snippets from the generic files section.