GetNewKeymapGrid() публичный статический Метод

public static GetNewKeymapGrid ( int numRows, int numCols, Keymap keymaps ) : Grid
numRows int
numCols int
keymaps Keymap
Результат System.Windows.Controls.Grid
Пример #1
0
        public KeymapLayer GetNewLayer(int numRows, int numCols, string name)
        {
            var keymaps    = GetNewKeymapsArray(numRows, numCols);
            var keymapGrid = KeymapGrid.GetNewKeymapGrid(numRows, numCols, keymaps);

            return(new KeymapLayer(numRows, numCols)
            {
                LayerName = name,
                LayerNumber = _currentLayerNumber++,
                KeymapGrid = keymapGrid,
                Keymaps = GetNewKeymapsArray(numRows, numCols)
            });
        }
Пример #2
0
        public void PopulateKeymapLayer(KeymapLayer keymapLayer)
        {
            keymapLayer.KeymapGrid = KeymapGrid.GetNewKeymapGrid(keymapLayer.NumberRows, keymapLayer.NumberCols, keymapLayer.Keymaps);

            for (var i = 0; i < keymapLayer.NumberRows; i++)
            {
                for (var j = 0; j < keymapLayer.NumberCols; j++)
                {
                    var keymap = keymapLayer.Keymaps[i, j];
                    keymap.UpdateDisplayText();

                    var button = keymap.Button;
                    button.FontSize = 10;
                    button.HorizontalContentAlignment = HorizontalAlignment.Center;
                    button.Content = keymap.DisplayText;
                }
            }
        }