public MainWindow() { InitializeComponent(); Style s = Resources["ButtonStyleNoHighlighting"] as Style; for (int i = 0; i < row; i++) { mainGrid.RowDefinitions.Add(new RowDefinition()); } for (int i = 0; i < column; i++) { mainGrid.ColumnDefinitions.Add(new ColumnDefinition()); } for (int i = 0; i < column; i++) { for (int j = 0; j < row; j++) { Tiltes.Add(new TilteGraphic(i, j, mainGrid, s)); //Tiltes.Add(new Tilte(i, j)); } } // puzzle 2 //Tiltes.FirstOrDefault(t => t.X == 3 && t.Y == 1).State = Tilte.States.LOCK; //Tiltes.FirstOrDefault(t => t.X == 4 && t.Y == 4).State = Tilte.States.LOCK; // puzzle 3 //Tiltes.FirstOrDefault(t => t.X == 4 && t.Y == 2).State = Tilte.States.LOCK; //Tiltes.FirstOrDefault(t => t.X == 2 && t.Y == 2).State = Tilte.States.LOCK; // puzzle 4 //Tiltes.FirstOrDefault(t => t.X == 1 && t.Y == 1).State = Tilte.States.LOCK; //Tiltes.FirstOrDefault(t => t.X == 3 && t.Y == 1).State = Tilte.States.LOCK; //Tiltes.FirstOrDefault(t => t.X == 1 && t.Y == 3).State = Tilte.States.LOCK; //Tiltes.FirstOrDefault(t => t.X == 2 && t.Y == 3).State = Tilte.States.LOCK; //Tiltes.FirstOrDefault(t => t.X == 4 && t.Y == 3).State = Tilte.States.LOCK; //Tiltes.FirstOrDefault(t => t.X == 4 && t.Y == 4).State = Tilte.States.LOCK; // puzzle 5 //Tiltes.FirstOrDefault(t => t.X == 2 && t.Y == 0).State = Tilte.States.LOCK; //Tiltes.FirstOrDefault(t => t.X == 3 && t.Y == 0).State = Tilte.States.LOCK; //Tiltes.FirstOrDefault(t => t.X == 4 && t.Y == 0).State = Tilte.States.LOCK; //Tiltes.FirstOrDefault(t => t.X == 0 && t.Y == 4).State = Tilte.States.LOCK; //Tiltes.FirstOrDefault(t => t.X == 1 && t.Y == 4).State = Tilte.States.LOCK; SequenceButton.Click += SequenceButton_Click; AutoPlay autoPlay = new AutoPlay(Tiltes); LogTextBlock.Text = autoPlay.Result; gp = new GamePlayGraphic(Tiltes); gp.TilteClickedInEditMode += Gp_TilteClickedInEditMode; SequenceButton_Click(null, null); }
private void Gp_TilteClickedInEditMode(object sender, GamePlayGraphic.TilteClickedInEditModeEventArgs e) { AutoPlay autoPlay = new AutoPlay(Tiltes); LogTextBlock.Text = autoPlay.Result; }