Esempio n. 1
0
        private void btnCardDetails_Click(object sender, RoutedEventArgs e)
        {
            Card       item     = null;
            CardDetail cdDetail = null;

            if (this.dgCardCollection.SelectedItems.Count > 0)
            {
                item = (Card)this.dgCardCollection.SelectedItem;
                try
                {
                    cdDetail = _cardManager.RetrieveCardDetail(item);
                    //var cardItem = (Card)this.dgCardCollection.SelectedItem;
                    var frmDetails = new frmCardDetails(_cardManager, cdDetail, CardDetailMode.View);
                    var result     = frmDetails.ShowDialog();
                    if (result == true)
                    {
                        refreshCardList();
                        dgCardCollection.ItemsSource = _cardList;
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message + "\n\n" + ex.InnerException.Message, "Oh no...");
                }
            }
            else
            {
                MessageBox.Show("Please make a selection.");
            }
        }