private void CreateNookBoxes() { for (int row = 0; row < BlackboxConfig.GameBoardRow; row++) { for (int column = 0; column < BlackboxConfig.GameBoardColumn; column++) { if (((row == 0) || (row == BlackboxConfig.GameBoardRow - 1)) && ((column == 0) || (column == BlackboxConfig.GameBoardColumn - 1))) { _boxs[row, column] = new NookBoxView(); _boxs[row, column].HorizontalAlignment = HorizontalAlignment.Left; _boxs[row, column].VerticalAlignment = VerticalAlignment.Top; _boxs[row, column].Width = BlackboxConfig.BoxWidth; _boxs[row, column].Height = BlackboxConfig.BoxHeight; _boxs[row, column].Margin = new Thickness(row * BlackboxConfig.BoxWidth, column * BlackboxConfig.BoxHeight, 0, 0); _boxs[row, column].Projection = new PlaneProjection(); _boxs[row, column].DataContext = _model.Boxes[row, column]; Binding binding = new Binding(); binding.Source = _model.Boxes[row, column]; binding.Path = new PropertyPath("BaseData"); binding.Mode = BindingMode.OneWay; _boxs[row, column].image.Tap += new EventHandler <GestureEventArgs>(_model.OnTap); this.LayoutRoot.Children.Add(_boxs[row, column]); } } } }
public void Accelerate() { for (int row = 0; row < BlackboxConfig.GameBoardRow; row++) { for (int column = 0; column < BlackboxConfig.GameBoardColumn; column++) { if (((row == 0) || (row == BlackboxConfig.GameBoardRow - 1)) && ((column == 0) || (column == BlackboxConfig.GameBoardColumn - 1))) { NookBoxView nookbox = (NookBoxView)_boxs[row, column]; nookbox.Accelerate(); } } } }