public FloorPlanGrid(FloorPlan floorPlan, ProjectFile projectFile) { InitializeComponent(); floorPlan.FloorNameChanged += FloorPlan_FloorNameChanged; floorPlan.NameChanged += FloorPlan_FloorNameChanged; floorPlan.ChangeManager.ChangeObserved += ChangeManager_ChangeObserved; this.projectFile = projectFile; FloorPlanViewModel vm = DataContext as FloorPlanViewModel; vm.ProjectFile = projectFile; floorPlan.Load(); vm.FloorPlan = floorPlan; AddRooms(); }