I have created a stack panel with 3 rectangles. I am trying to make a horizontal stack bar graph in UWP. so that the width of the rectangle is set through c program depending on the percentage.
<StackPanel Name="Graph" Orientation="Horizontal">
<Rectangle Name="PosBlock" Fill="#9EE000" Height="20" RadiusX="10" RadiusY="20" />
<Rectangle Name="NeuBlock" Fill="#FFBA00" Height="20" RadiusX="10" RadiusY="20"/>
<Rectangle Name="NegBlock" Fill="#D61602" Height="20" RadiusX="10" RadiusY="20"/>
</StackPanel>
Using this code I can get 3 rectangles with individually round corners like this image. See Image, 3rd rectangle width set to 0 . I dont want a gap between these rectangles. But i want rounded corners at the 2 ends. so i did this
<StackPanel Name="Graph" Orientation="Horizontal" CornerRadius="12,12,12,12">
<Rectangle Name="PosBlock" Fill="#9EE000" Height="20"/>
<Rectangle Name="NeuBlock" Fill="#FFBA00" Height="20"/>
<Rectangle Name="NegBlock" Fill="#D61602" Height="20"/>
</StackPanel>
But the rectangle corners are not cropped even if the stack panel corners are rounded. it looks like this
.
what should i do now?