Click here to Skip to main content
15,895,011 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Data binding from a List to a Grid Pin
ABitSmart25-Jun-09 5:48
ABitSmart25-Jun-09 5:48 
GeneralRe: Data binding from a List to a Grid Pin
fjparisIII25-Jun-09 8:22
fjparisIII25-Jun-09 8:22 
GeneralRe: Data binding from a List to a Grid Pin
fjparisIII25-Jun-09 5:41
fjparisIII25-Jun-09 5:41 
GeneralRe: Data binding from a List to a Grid Pin
ABitSmart25-Jun-09 5:45
ABitSmart25-Jun-09 5:45 
GeneralRe: Data binding from a List to a Grid Pin
fjparisIII25-Jun-09 8:26
fjparisIII25-Jun-09 8:26 
AnswerRe: Data binding from a List to a Grid Pin
mittalamit24-Jun-09 20:18
mittalamit24-Jun-09 20:18 
GeneralRe: Data binding from a List to a Grid (unfortunately, it did not work) [modified] Pin
fjparisIII25-Jun-09 4:56
fjparisIII25-Jun-09 4:56 
AnswerRe: Data binding from a List to a Grid Pin
Mark Salsbery25-Jun-09 6:58
Mark Salsbery25-Jun-09 6:58 
Bindings aren't that complicated if you break them down a bit.

A binding consists of a source and a target, with hooks to look at the
data as it goes from one to the other.

The target is generally simple.

The source seems to give people the most trouble at first.

Read this - then read it again - and again: Binding Sources Overview[^]
(you'll be introduced to the magic DataContext there)

Also read this entire section: Data Binding[^]
(Note: there's a whole bunch of binding examples at the end!)


In your specific example here, you have a target not seeing changes on the source.
The framework cannot possibly know when you've changed something on the source without
some kind of notification. This notification must be provided by you, either through
the INotifyCollectionChanged interface or the INotifyPropertyChanged interface.

You didn't specify what "ignores any data I write to PhotoMetadataList" means.

If you mean adding/deleting/etc items from the list, then no - List<> does not implement
the necessary INotifyCollectionChanged interface so the target won't see those changes.
You should either implement INotifyCollectionChanged on a cusom List<> class or
use a class that does it for you - like ObservableCollection<>

If you meant changes to items in the list, then the type (class) of object the list contains
(PhotoMetadata in your case) needs to implement the INotifyPropertyChanged
interface, and any property of that class that can be or is binded to needs to use the
INotifyPropertyChanged implementation whenever its value changes.

Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: Data binding from a List to a Grid Pin
fjparisIII25-Jun-09 7:31
fjparisIII25-Jun-09 7:31 
GeneralRe: Data binding from a List to a Grid Pin
Mark Salsbery25-Jun-09 7:48
Mark Salsbery25-Jun-09 7:48 
GeneralRe: Data binding from a List to a Grid Pin
fjparisIII25-Jun-09 8:30
fjparisIII25-Jun-09 8:30 
GeneralRe: Data binding from a List to a Grid Pin
fjparisIII25-Jun-09 7:39
fjparisIII25-Jun-09 7:39 
GeneralRe: Data binding from a List to a Grid Pin
Pete O'Hanlon25-Jun-09 9:07
mvePete O'Hanlon25-Jun-09 9:07 
GeneralRe: Data binding from a List to a Grid Pin
fjparisIII25-Jun-09 9:29
fjparisIII25-Jun-09 9:29 
AnswerRe: Data binding from a List to a Grid Pin
Mark Salsbery25-Jun-09 7:23
Mark Salsbery25-Jun-09 7:23 
GeneralRe: Data binding from a List to a Grid Pin
fjparisIII25-Jun-09 7:40
fjparisIII25-Jun-09 7:40 
GeneralRe: Data binding from a List to a Grid Pin
Mark Salsbery25-Jun-09 7:46
Mark Salsbery25-Jun-09 7:46 
GeneralRe: Data binding from a List to a Grid Pin
fjparisIII25-Jun-09 8:33
fjparisIII25-Jun-09 8:33 
AnswerRe: Data binding from a List to a Grid (Everything works now) [modified] Pin
fjparisIII25-Jun-09 12:19
fjparisIII25-Jun-09 12:19 
QuestionWPF Slider project Pin
fgimenez24-Jun-09 8:14
fgimenez24-Jun-09 8:14 
AnswerRe: WPF Slider project Pin
Christian Graus24-Jun-09 15:26
protectorChristian Graus24-Jun-09 15:26 
GeneralRe: WPF Slider project Pin
fgimenez29-Jun-09 2:49
fgimenez29-Jun-09 2:49 
QuestionSilverlight2Chat Pin
deep7624-Jun-09 4:59
deep7624-Jun-09 4:59 
AnswerRe: Silverlight2Chat Pin
Mark Salsbery24-Jun-09 7:35
Mark Salsbery24-Jun-09 7:35 
GeneralRe: Silverlight2Chat Pin
deep7624-Jun-09 7:41
deep7624-Jun-09 7:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.