public void Execute(object parameter) { object[] parameters = (object[])parameter; PuzzleScreen screen = (PuzzleScreen)parameters[0]; SquareViewModel square = (SquareViewModel)parameters[1]; Vector2D start = screen.PicrossViewModel.start; if (start == null) { screen.PicrossViewModel.start = square.Square.Position; } else { int smallest; int biggest; if (start.X == square.Square.Position.X) { if (square.Square.Position.Y < start.Y) { smallest = square.Square.Position.Y; biggest = start.Y; } else { smallest = start.Y; biggest = square.Square.Position.Y; } while (smallest <= biggest) { screen.PicrossViewModel.Grid[new Vector2D(start.X, smallest)].Square.Contents.Value = Square.FILLED; smallest++; } } else if (start.Y == square.Square.Position.Y) { if (square.Square.Position.X < start.X) { smallest = square.Square.Position.X; biggest = start.X; } else { smallest = start.X; biggest = square.Square.Position.X; } while (smallest <= biggest) { screen.PicrossViewModel.Grid[new Vector2D(smallest, start.Y)].Square.Contents.Value = Square.FILLED; smallest++; } } screen.PicrossViewModel.start = null; } }
public CycleCommand(SquareViewModel squareViewModel) { this.squareViewModel = squareViewModel; canExecute = true; }
public SquareRightClickCommand(SquareViewModel vm) { _viewModel = vm; }
public Left(SquareViewModel parent) { Parent = parent; }
public Right(SquareViewModel parent) { Parent = parent; }
public CycleCommand(SquareViewModel viewmodel) { _viewModel = viewmodel; }
public SquareStateCommand(SquareViewModel squareViewModel) { _sv = squareViewModel; _execute = true; }