CustomPreview example?

The docs for CustomPreviewAttribute don’t give any indication on exactly how it should be used and I can’t find any good examples. Search isn’t too helpful either. Can anyone provide a good sample of how to use this? I can put CustomPreviewAttribute on a class, but what base class houdl it extend? What methods do I need to override? How should I go about doing this?

Thanks in advance!

Here you have an example.