Skip to content

NullReferenceException in object.GetType() when using ListView #6

@stenhen

Description

@stenhen

When using the MV-converter in an UWP ListBox control everything works fine.
However, I switched to using a ListView where an "empty placeholder rectangle" is used in the virtualization mechanism the short time the actual ListViewItem (with it's binded data) is loaded. This is to make e.g. scrolling smoother. But then I get the following exception:

Exception {System.NullReferenceException: Object reference not set to an instance of an object.
at System.Object.GetType()
at WinRTMultibinding.Foundation.Data.Binding.CheckIfBindingModeIsValid(Object source, String path, BindingMode mode)
at WinRTMultibinding.Foundation.Data.Binding.SetBinding(Object source, Boolean shouldRaiseOnSourcePropertyValueChanged)
at WinRTMultibinding.Common.Extensions.CollectionExtensions.ForEach[T](IEnumerable1 source, Action1 action)
....

Well somehow it's logical, since the actual source that's going into the converter isn't loaded yet.

Any idea how to get around or solve this?

Trying to set UpdateSourceTrigger="Explicit" in order to prevent converter to run until source is loaded didn't help.

Many thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions