Skip to content

Ch 8 Two Decks Downloadable exercise problem #37

@Delgathar

Description

@Delgathar

Hello,

I've been scratching my head over this and can't seem to figure it out. Basically, something is not happening right with my data bindings. When I debug in local I get leftDeck error cs0103 - Does not exist in this context. But somehow rightDeck seems to work fine. At least it calls the initializer and gets populated with cards. It doesn't get cleared for some reason, but that is the next bug to figure out.

MainWindow - Copy.xaml.txt
MainWindow.xaml - Copy.cs.txt

Deck - Copy.cs.txt
image

As shown in the picture. Resources does populate with key 0- rightDeck and key 1-leftDeck. leftDeck was first in the xaml so I'm not sure why it is the second key and if it might be related to the problem. I tried forcing the leftDeck to populate by adding the statement to main
Deck leftDeck = Resources["leftDeck"] as Deck;

this did populate the field correctly in my watch list and show it full of 52 cards, but the listBox did not populate.

Thank you for any help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions