While working on my Radar control
, I found that I had the need to clip the contents of a rectangular Panel by a bounding ellipse. In Silverlight, that’s a very trivial task:
The XAML above clips every child inside the Canvas that is not contained by the EllipseGeometry. But it’s a very common case that you won’t know the dimensions of the containing Canvas until runtime. Even worse, your canvas dimensions may change multiple times during runtime.
We need some way to update the EllipseGeometry during runtime. Sure, you could easily write some one-off code to do this, but it’s better if we can encapsulate the logic so that it can be re-used. ...(Read whole news on source site)