Observable collections

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of Don Jones Don Jones 7 months ago.

  • Author
    Posts
  • #38661
    Profile photo of David Zemdegs
    David Zemdegs
    Participant

    Greetings,
    I just came across this line of code:
    New-Object 'System.Collections.ObjectModel.ObservableCollection[System.Object]'

    When I search I get loads of examples but I couldn't find a basic description.
    Why would I use an observable collection over a normal collection?
    It appears to be aligned with windows forms but does it have uses other than with forms?
    Thanks
    David

  • #38664
    Profile photo of Don Jones
    Don Jones
    Keymaster

    They fire events when the collection is modified, so you can write code to respond to that. Thus, the collection is "observable."

You must be logged in to reply to this topic.