Method Equals
Equals(object)
We override Equals() to seal it to prevent custom Equals() implementations.
There are only two scenarios where overriding Equals makes sense:
1. You are a value type (passed by copy).
2. You are an immutable reference type (e.g., System.String).
Otherwise you are going to cause problems with keyed and some types of sorted datastructures because your values can mutate to be equals or not equals while they reside in the store (bad news for System.Collections(.Generic)).
Furthermore, defining equality for two DOs is a very slippery slope. Are two brushes "equal" if they both paint red? What if one is only red this frame because it is animated? What if one is databound? What if one is frozen? ...and so on.
Since a DO can never be immutable (attached properties, etc.) it makes sense to disallow overriding of Equals.
public override sealed bool Equals(object obj)
Parameters
obj
object