I’m planning to create a custom progress bar control, that supports progress sectioning. The final look will be:

I am comparatively new to Silverlight control development, so here is my idea and question:
- I will be defining control’s structure in XAML as an
ItemsControl. ItemsControlelement will be bound to a data source, that will contain bar sections.- An
ItemTemplateis going to define the way those sections are drawn.
The “trick” is, that the first and the last section should have a left and right rounded corners respectively. How can I define this constrain, so that the first and the last item from a source are drawn with rounded corners? Could I do it in XAML, or from code. If code, where do I inject the logic?
You can create a List of Border, take the first and last Border from your List and apply a corner radius.
XAML:
C#: