public void CreateGame(Grid gridImageViewer, ClassGameCreate objectCreateGame, Image ImageViewer1) { double sizeW = gridImageViewer.Width / CountColumns, sizeH = gridImageViewer.Height / CountRow, sizeWPix = ImageViewer1.Source.Width / CountColumns, sizeHPix = ImageViewer1.Source.Height / CountRow; prepareSettings(); for (int i = 0, index = 0; i < CountRow; i++) { for (int j = 0; j < CountColumns; j++, index = (i * CountColumns + j)) { Border newB = objectCreateGame.CreateViewImageDynamically(ImageViewer1, sizeW, sizeH, sizeWPix, sizeHPix, i, j); newB.Tag = index.ToString(); elementsGame[index] = newB; gridImageViewer.Children.Add(newB); } } ShuffleElements(); }
public MainWindow() { InitializeComponent(); objectGameCreate = new ClassGameCreate(Directory.GetCurrentDirectory()); objectGameLogic = new ClassGameLogic(); }