using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; namespace Dominion.NET_WPF { /// /// Interaction logic for wCardViewer.xaml /// public partial class wCardViewer : Window { public wCardViewer() { InitializeComponent(); DominionBase.Cards.CardCollection cards = DominionBase.Cards.CardCollection.GetAllCards(c => c.Location != DominionBase.Cards.Location.Invisible); cards.Sort(delegate(DominionBase.Cards.Card c1, DominionBase.Cards.Card c2) { return c1.Name.CompareTo(c2.Name); }); cbCards.ItemsSource = cards; } private void Window_Close_Click(object sender, RoutedEventArgs e) { this.Close(); } private void cbCards_SelectionChanged(object sender, SelectionChangedEventArgs e) { ttcCard.ICard = (sender as ComboBox).SelectedItem as DominionBase.ICard; if (ttcCard.ICard == null) ttcCard.Visibility = System.Windows.Visibility.Hidden; else ttcCard.Visibility = System.Windows.Visibility.Visible; ttcCard.InvalidateVisual(); } } }