Created
May 6, 2014 22:18
-
-
Save dharmatech/ef47056713a3de1df3d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using Windows.UI.Xaml.Controls; | |
using Windows.UI.Xaml.Media; | |
using Windows.UI.Xaml.Shapes; | |
using Windows.UI; | |
using Windows.Foundation; | |
namespace ManyLinesTestCs | |
{ | |
public sealed partial class MainPage : Page | |
{ | |
public MainPage() | |
{ | |
this.InitializeComponent(); | |
var geometryGroup = new GeometryGroup(); | |
canvas.Children.Add( | |
new Path() | |
{ | |
Stroke = new SolidColorBrush(Colors.SteelBlue), | |
StrokeThickness = 1.0, | |
Data = geometryGroup | |
}); | |
var random = new Random(); | |
button.Click += (s, e) => | |
{ | |
foreach (var elt in Enumerable.Range(0, 2000)) | |
geometryGroup.Children.Add( | |
new LineGeometry() | |
{ | |
StartPoint = new Point(random.Next((int)canvas.Width), random.Next((int)canvas.Width)), | |
EndPoint = new Point(random.Next((int)canvas.Width), random.Next((int)canvas.Width)) | |
}); | |
}; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment