private void PlaceableControl_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { RoomPlanViewModel vm = DataContext as RoomPlanViewModel; if (selectedTileControl != null) { updateTile = false; selectedTileControl.Background = Brushes.Transparent; selectedTileControl = null; vm.SelectedTileAssignment = null; updateTile = true; } if (selectedPlaceableControl != null) { selectedPlaceableControl.Background = Brushes.Transparent; } PlaceableControl placeableControl = sender as PlaceableControl; PlaceableAssignment placeableAssignment = vm.RoomPlan.PlaceableAssignments.FirstOrDefault(x => x.Control.Tag == placeableControl.Tag); vm.SelectedPlaceableAssignment = placeableAssignment; placeableControl.Background = highlightColor; selectedPlaceableControl = placeableControl; updateTile = false; vm.SelectedAvailableTile = null; updateTile = true; vm.SelectedTabIndex = 2; }
public PlaceableControl(PlaceableAssignment placeableAssignment, Size canvasBounds, bool showNoteIcon = true) { InitializeComponent(); PlaceableAssignment = placeableAssignment; this.canvasBounds = canvasBounds; if (!showNoteIcon) { noteIcon.Source = null; } }
public PlaceableControl(Placeable placeable, Size canvasBounds, Point insertPoint) { InitializeComponent(); this.canvasBounds = canvasBounds; PlaceableAssignment = new PlaceableAssignment(placeable, insertPoint.X, insertPoint.Y); }