I’ve tried MSDN but there is not an example for deriving from Freezable.
Update:
Yes in the MSDN there’s an example with animations but it’s too complicated.
need something simpler to understand freezable.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Documentation
In the MSDN documentation of the Freezable class, in the Remarks section, you can find the following paragraph:
This overview contains a section Creating Your Own Freezable Class, which contains the theoretical background for what you want to do. To find an example, follow the link at the bottom of that section:
Example
Since you specifically asked for a simple example, here is one (adapted from the MSDN page of Freezable.CreateInstanceCore). Remember the following sentence from the theory page:
Let’s say we make a custom class
MySimpleColor, which has exactly one boolean propertyIsRed. To make this class Freezable, we just have to overrideCreateInstanceCore:That’s it. The code inherited from
Freezableensures that theFreezablemethods such asFreeze()orClone()work exactly as intended.