Example #1
0
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if ((int)this.Choise == -1)
     {
         this.Choise = PromotionChoise.Queen;
     }
 }
Example #2
0
        private void Clicked(object sender, RoutedEventArgs e)
        {
            string n = ((Button)sender).Content.ToString();
            this.Choise = n == "Knight" ? PromotionChoise.Knight :
                n == "Rook" ? PromotionChoise.Rook :
                n == "Bishop" ? PromotionChoise.Bishop :
                PromotionChoise.Queen;

            this.Close();
        }