/// <summary> /// Note: you must add one or more PathFigure to this collection /// </summary> internal static StaticPathElement StaticPathHelper(string key, Codespace codespace, Brush strokeBrush, int strokethickness, string imageSrc) { var sp = new StaticPathElement(key, codespace); sp.Init(strokeBrush, strokethickness, imageSrc); /* * <Path Stroke ="Black" StrokeThickness="2" Data="M100,50 L140,60 L150,100 L125,120 L90,110 L80,80 z M15,40 L70,15 L80,30 L65,70 L80,115 L10,80 z M160,40 L170,50 L180,90 L180,120 L140,150 L130,130 L160,100 z" > * <Path.Fill> * <ImageBrush ImageSource="" TileMode="None" Stretch="UniformToFill" /> * </Path.Fill> * * </Path> */ return(sp); }
private void CreateStatics() { //Create a line geometry 3x1 grid units StaticPathElement se1 = CodespaceElementFactory.StaticPathHelper("STATIC1", this, Brushes.Pink, 2, @"C:\tmp\Assets\Backgrounds\CircuitBoard_Pink.png"); se1.AddFigure(0, 0, PathHelper.PathFigureFromGrid(5, 3, _gridSize)); se1.AddFigure(GridUnits(6, Ordinal.Right), GridUnits(0, Ordinal.Down), PathHelper.PathFigureFromGrid(3, 2, _gridSize)); se1.AddFigure(GridUnits(6, Ordinal.Right), GridUnits(3, Ordinal.Down), PathHelper.PathFigureFromGrid(3, 2, _gridSize)); se1.AddFigure(GridUnits(6, Ordinal.Right), GridUnits(8, Ordinal.Down), PathHelper.PathFigureFromGrid(3, 2, _gridSize)); se1.AddFigure(GridUnits(6, Ordinal.Right), GridUnits(6, Ordinal.Down), PathHelper.PathFigureFromGrid(3, 2, _gridSize)); se1.AddFigure(GridUnits(2, Ordinal.Right), GridUnits(4, Ordinal.Down), PathHelper.PathFigureFromGrid(1, 8, _gridSize)); AddElement(se1, GridUnits(1, Ordinal.Right), GridUnits(0, Ordinal.Down)); }