Exemple #1
0
        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;
        }
Exemple #2
0
 public PlaceableControl(PlaceableAssignment placeableAssignment, Size canvasBounds, bool showNoteIcon = true)
 {
     InitializeComponent();
     PlaceableAssignment = placeableAssignment;
     this.canvasBounds   = canvasBounds;
     if (!showNoteIcon)
     {
         noteIcon.Source = null;
     }
 }
Exemple #3
0
 public PlaceableControl(Placeable placeable, Size canvasBounds, Point insertPoint)
 {
     InitializeComponent();
     this.canvasBounds   = canvasBounds;
     PlaceableAssignment = new PlaceableAssignment(placeable, insertPoint.X, insertPoint.Y);
 }