I am writing a WPF application, this is a Contact Manager App for practice..this is my first WPF project....
I have designed the UI in Photoshop and implimented it in WPC C# VS 2012. I have a listbox on the Main window...this is supposed to hold the Contact Info....I am having some trouble adding the info....I have created a Contact class and have public properties for the info I want to add to the listbox....then in the form load event I add each Contact to A List<Contact>..this is where I am having trouble...when I add the info...it doesnt show in the listbox corectly...all it adds is "MyBlackBook.Contact" for each contact added to the list..... code is below
this info is for testing only...I would like to know why the info isnt displaying correctly.
any help is appreciated...
-InkedGFX
I have designed the UI in Photoshop and implimented it in WPC C# VS 2012. I have a listbox on the Main window...this is supposed to hold the Contact Info....I am having some trouble adding the info....I have created a Contact class and have public properties for the info I want to add to the listbox....then in the form load event I add each Contact to A List<Contact>..this is where I am having trouble...when I add the info...it doesnt show in the listbox corectly...all it adds is "MyBlackBook.Contact" for each contact added to the list..... code is below
private void Window_Loaded_1(object sender, RoutedEventArgs e) { contactList.Add(new Contact() { ID = "1", ContactName = "Gene | ", Address = "1234 right st | ", City = "AnyWhere | ", State = "State | ", Zip = "34221 | ", Birthday = "01/29/1970 | ", ImageSource = "#####" }); contactList.Add(new Contact() { ID = "2", ContactName = "Gene | ", Address = "1234 right st | ", City = "AnyWhere | ", State = "State | ", Zip = "34221 | ", Birthday = "01/29/1970 | ", ImageSource = "#####" }); contactList.Add(new Contact() { ID = "3", ContactName = "Gene | ", Address = "1234 right st | ", City = "AnyWhere | ", State = "State | ", Zip = "34221 | ", Birthday = "01/29/1970 | ", ImageSource = "#####" }); lstContacts.ItemsSource = contactList; }
this info is for testing only...I would like to know why the info isnt displaying correctly.
any help is appreciated...
-InkedGFX