locked
WinRT: ItemsControl OnItemChanged event is Windows Runtime Object

    Question

  • Hi there, I'm trying to write custom universal app ItemsControl and I depend in OnItemsChaned event. I expected to get some info about the event type (add,reset, and so on) and index, but the only thing I get is Windows Runtime Object derived from System.__ComObject. But in debugger this object actually has the necessary properties, but how do I access them? Thanks a lot.
    Wednesday, May 28, 2014 1:25 PM

Answers

  • You would need to cast the object to a concrete type, but since the type isn't documented it isn't something you can rely on.

    You'll be better off accessing the Items property since you know that it has just changed.

    --Rob

    Thursday, May 29, 2014 1:10 AM
    Owner
  • Unfortunately since the implementation is explicitly not documented I can't help you out with it. That would do you a disservice since the implementation could change.

    --Rob

    Wednesday, June 04, 2014 4:39 AM
    Owner

All replies

  • You would need to cast the object to a concrete type, but since the type isn't documented it isn't something you can rely on.

    You'll be better off accessing the Items property since you know that it has just changed.

    --Rob

    Thursday, May 29, 2014 1:10 AM
    Owner
  • Well, but I need to know exactly the type of action happened and the new index of the element.

    I found one way is to subscribe to ItemContainerGenerator event. But would really be grateful for help if there's another way to know, as the generator also has some sort of abstraction, where action is not a enum, but simply an int

    Thursday, May 29, 2014 7:25 AM
  • Unfortunately since the implementation is explicitly not documented I can't help you out with it. That would do you a disservice since the implementation could change.

    --Rob

    Wednesday, June 04, 2014 4:39 AM
    Owner