Public Sub Draw(ByRef container As System.Windows.Controls.Panel, ByVal table As ITable) Implements IMovableObject.Draw If Not container.Children.Contains(polygon) Then If container.GetType() Is GetType(Canvas) Then dYRatio = (container.ActualHeight / table.Height) dXRatio = (container.ActualWidth / table.Width) transforms.Children.OfType(Of ScaleTransform)()(0).ScaleY = -1 * dYRatio transforms.Children.OfType(Of ScaleTransform)()(0).ScaleX = dXRatio transforms.Children.OfType(Of TranslateTransform)()(0).Y = container.ActualHeight yInversionFactor = -1 dContainerHeight = container.ActualHeight End If polygon.RenderTransform = transforms container.Children.Add(polygon) End If End Sub
Public Overrides Function Clone() As Object Dim copy As New clsTrussSection(Me.Name) Dim ar As String = System.Windows.Markup.XamlWriter.Save(polygon) Dim poly As Polygon = System.Windows.Markup.XamlReader.Load(System.Xml.XmlReader.Create(New System.IO.StringReader(ar))) poly.Name = "Polygon" & Math.Floor((Rnd() * 10000)).ToString() For Each Point In MyBase.polygon.Points poly.Points.Add(New Point(Point.X, Point.Y)) Next poly.RenderTransform = polygon.RenderTransform copy.polygon = poly Return copy End Function
Contains
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)