1

Sure, the Freezable class and the Visual class in WPF have a totally different purpose. My question focuses more on the difference between objects which implement either the Visual class or the Freezable class. Because they both are normally related to graphical issues I got confused.

So, what exactly is the purpose of a Freezable in the manner of graphical representation and a Visual?

Sam
  • 1,301
  • 1
  • 17
  • 26

1 Answers1

1

Visual implements the concept of a 2D object that generally requires visual presentation in a roughly rectangular region. The actual rendering of a Visual happens in other classes (it is not self-contained), but the Visual class provides a known type that is used by rendering processes at various levels. Visual implements hit testing, but it does not expose events that report hit-testing positives (these are in UIElement). For more information, see Visual Layer Programming.

http://msdn.microsoft.com/en-us/library/ms753209(v=vs.110).aspx

Freezable simulates immutability in a mutable object by providing the means to generate copies of the object when an immutable object is required or desired for performance reasons. The Freezable type provides a common basis for certain graphics elements such as geometries and brushes, as well as animations. Notably, a Freezable is not a Visual; it can hold properties that become subproperties when the Freezable is applied to fill a property value of another object, and those subproperties might affect rendering. For more information, see Freezable Objects Overview.

http://msdn.microsoft.com/en-us/library/ms750509(v=vs.110).aspx

dev hedgehog
  • 8,698
  • 3
  • 28
  • 55
  • Thank you for your answer, dev hedgehog. Even it isn't actually the overall explanation I was looking for. I know that my question is not black and white =). – Sam Oct 25 '13 at 11:03
  • Its a broad topic. Though not sure what you exactly need. Try to give us an exact issue to solve instead such discussion alike topics – dev hedgehog Oct 25 '13 at 11:26
  • Yes, you are right. However, I think I found what I was looking for. The Instructions (DUCE.IResource), which the Visual encapsulates indirectly, are implemented by Freezables e.g. by the abstract Drawing class. I will try to visualize this pattern by a UML diagram and post it here. – Sam Oct 25 '13 at 16:45