In my WPF application, I am drawing polylines to indicate a mesh (triangles and quadilaterals) based on X/Y coordinates read from a file. This file contains multiple zones, and each zone contains many x/y coordinates. For each zone, I need to draw it's mesh, based on it's X/Y coordinates.
In my C# code, I am creating Polylines from a set of 4 x/y coordinates, then adding the Polyline to a single cell Grid panel to be displayed.
Zone 1's Y height is 18 feet, and with each subsequent Zone generated, the Y height will increase, up to Zone 67, which is 165 feet.
The problem is that the image displayed in the Grid is always the same. However, the X length seems to increase as it should.
Following is my code that creates the Polyline and adds it to the Grid.
Polyline polyline2 = new Polyline()
{
Stroke = System.Windows.Media.Brushes.DarkBlue,
StrokeThickness = .8,
SnapsToDevicePixels = true,
HorizontalAlignment = System.Windows.HorizontalAlignment.Left,
VerticalAlignment = System.Windows.VerticalAlignment.Bottom,
Stretch = Stretch.Uniform
};
foreach (Point point in points)
{
polyline2.Points.Add(point);
}
gridPlot.Children.Add(polyline2);
Following is my XAML code;
<igDock:ContentPane x:Name="contentPanePlot2" Tag="PlotView2" Header="Plot View 2" TabHeader="Plot View 2" AllowDockingLeft="True" AllowDockingRight="True" PinButtonVisibility="Collapsed" CloseButtonVisibility="Collapsed" WindowPositionMenuVisibility="Collapsed">
<Grid x:Name="gridPlot" Grid.Row="1" Margin="20">
<Grid.LayoutTransform>
<ScaleTransform ScaleY="-1"/>
</Grid.LayoutTransform>
</Grid>
</igDock:ContentPane>
How can I force the display to size correctly in the Y (vertical) direction?
Following are links to two images which explain the problem.
The first is Zone 1 and the second is Zone 67.
https://skydrive.live.com/#cid=474829871261F415&id=474829871261F415%21131
https://skydrive.live.com/#cid=474829871261F415&id=474829871261F415%21131
Regards