public MainWindow() { InitializeComponent(); doc = new DistanceDocument(); doc.Changed += doc_Changed; doc.MicrophoneAdded += doc_MicrophoneAdded; doc.ReferencePointAdded += doc_ReferencePointAdded; calc = new Calculator(doc); dataGrid.DataContext = calc.Distances; doc.Plan = new ImageBrush(new BitmapImage(new Uri(BaseUriHelper.GetBaseUri(this), "Images/plan.jpg"))); doc.Scale = 0.3; // meter per pixel }
private void Main_Load(object sender, EventArgs e) { pMainArea.AllowDrop = true; pMainArea.DragEnter += pMainArea_DragEnter; pMainArea.DragDrop += pMainArea_DragDrop; pMainArea.MouseClick += pMainArea_MouseClick; doc = new DistanceDocument(); doc.Changed += doc_Changed; doc.MicrophoneAdded += doc_MicrophoneAdded; calc = new Calculator.Calculator(doc); dataGridView1.DataSource = calc.Results; doc.Plan = new Bitmap(@"C:\Users\Henrik\Documents\visual studio 2013\Projects\Distance\Distance\plan.jpg"); doc.Scale = 0.3F; // meter per pixel }