ОК. Я получил следующее
C # код:
private void Grid_SizeChanged(object sender, SizeChangedEventArgs e)
{
BackgroundPathChange();
}
private void BackgroundPathChange()
{
int heightDesign = 300;
int widthDesign = 300;
var separatorLine = new List<Point>(){
new Point(20, 1.1666667),
new Point(45.5, 110.99967),
new Point(45.5, 187.49966),
new Point(45.5, 237.49966),
new Point(19.5, 296.49966),
new Point(295.5, 295.49966),
new Point(289.5, 0.49966663)
};
rightBackgroundPath.Data = Geometry.Parse(
string.Format("M{0},{1} L{2},{3} {4},{5} {6},{7} {8},{9} {10},{11} {12},{13}",
(int)separatorLine[0].X, (int)(separatorLine[0].Y * gridContainer.ActualHeight / heightDesign),
(int)separatorLine[1].X, (int)(separatorLine[1].Y * gridContainer.ActualHeight / heightDesign),
(int)separatorLine[2].X, (int)(separatorLine[2].Y * gridContainer.ActualHeight / heightDesign),
(int)separatorLine[3].X, (int)(separatorLine[3].Y * gridContainer.ActualHeight / heightDesign),
(int)separatorLine[4].X, (int)(separatorLine[4].Y * gridContainer.ActualHeight / heightDesign),
(int)(separatorLine[5].X * gridContainer.ActualWidth / widthDesign),
(int)(separatorLine[5].Y * gridContainer.ActualHeight / heightDesign),
(int)(separatorLine[6].X * gridContainer.ActualWidth / widthDesign),
(int)(separatorLine[6].Y * gridContainer.ActualHeight / heightDesign)
));
}
XAML:
<Grid SizeChanged="Grid_SizeChanged" x:Name="gridContainer">
<Path
x:Name="rightBackgroundPath"
Data="M20,1 L44,110.99967 45.5,187.49966 45.5,237.49966 19.5,300 300,300 300,0"
Fill="Yellow" Stroke="Green"/>
</Grid>
Может это как-нибудь упростить?