// c'tor public UIGrid(UIGridEvent onSelect, UIGridEvent onCancel, Point maxDimensions) { this.Select = onSelect; this.Cancel = onCancel; this.maxDimensions = maxDimensions; grid = new UIGridElement[maxDimensions.X, maxDimensions.Y]; // Init to null. for (int j = 0; j < maxDimensions.Y; j++) { for (int i = 0; i < maxDimensions.X; i++) { grid[i, j] = null; } } actualDimensions = new Point(0, 0); focusIndex = new Point(0, 0); // TODO need to decide how to set this if not already set. Should never point // to a null element? Does this mean we can't have a row of diagonal elements? // Why bother about supporting something that's stupid, just limit it. this.commandMap = CommandMap.Deserialize(this, "UiGridControl.xml"); } // end of UIGrid c'tor