コード例 #1
0
        private void Image_PrivateCard2_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            Card chosenCard;

            if (!ChooseCard.TryShowChooseCardDialog(out chosenCard))
            {
                return;
            }

            this.InvokeUIChange(() => this.Image_PrivateCard2.Source = chosenCard.CardImage);
        }
コード例 #2
0
        public static bool TryShowChooseCardDialog(out Card chosenCard)
        {
            ChooseCard window = new ChooseCard();

            window.InitializeComponent();
            window.ShowDialog();

            chosenCard = window.SelectedCard;

            if (window.Canceled)
            {
                return(false);
            }

            return(chosenCard != null);
        }