View Issue Details

IDProjectCategoryView StatusLast Update
0000576NoesisGUIUnitypublic2018-11-23 10:41
ReporterScherub Assigned Tosfernandez  
PrioritynormalSeveritymajor 
Status assignedResolutionopen 
Summary0000576: Registering a collection as dependency property is already initialized even if default value is set to null
Description

This bug entry is related to issue #570 and you can find the project file under issue #575.

I've integrated the fix mentioned in issue #570 and it kind of works when I set the default value to null. The strange thing is now that the ObservableCollection "Tabs" that I registered is already instantiated within the OnPostInit() method. I can only guess but it probably happens because I define the values in XAML. If this is correct then it should be changed as WPF would tell you that the collection "Tabs" is still null.

The other problem is that the collection is already filled with values so the CollectionChanged event is never called. That's also different to WPF.

In the files of the project there are lots of missing safety checks as I was just trying to figure out a way to work around these problems.

PlatformAny

Activities

sfernandez

sfernandez

2015-02-17 12:03

manager   ~0002093

Yes, our parser is automatically creating the collection when you populate the collection property in the xaml, so you don't have to explicitly write a node in the xaml with the collection type:


<Object>
<Object.List>
<!--ItemList--> <!-- This becomes optional -->
<Item/>
<Item/>
<Item/>
<!--/ItemList--> <!-- ... -->
</Object.List>
</Object>

And as long as the items are specified in the xaml, they are serialized with the collection in the xaml resource. Then, as you load the xaml, you already have those items added to the collection when the OnPostInit() gets called.

Is this behavior a problem?

Scherub

Scherub

2015-02-17 14:02

reporter   ~0002100

You mean despite the fact that it works different in WPF? :P

Okay, to be more serious I have to think this through. The problem here was mainly that I expected a different beahviour and took me a while to figure out what's going on and why the CollectionChanged event was never called.

And I know there were problems/restrictions in v1.1 when you serialized other UserControls and / or collections so instead of this I changed everything so it was created dynamically.

I'll take another look at it and tell you how it went.

sfernandez

sfernandez

2015-02-17 14:12

manager   ~0002102

:)

It's just to prioritize tasks, if you can live with current behavior for a while, we can assign it a low priority.

Of course, the right thing is to behave exactly as WPF, and we will change this.

Scherub

Scherub

2015-02-17 19:15

reporter   ~0002107

Leave it as is for now. Unfortunately before I can continue you have to fix #575 first or least tell me what's causing it so I may be able to circumvent it.

Issue History

Date Modified Username Field Change
2015-02-16 23:12 Scherub New Issue
2015-02-17 11:54 sfernandez Assigned To => sfernandez
2015-02-17 11:54 sfernandez Status new => assigned
2015-02-17 12:03 sfernandez Note Added: 0002093
2015-02-17 12:03 sfernandez Status assigned => feedback
2015-02-17 14:02 Scherub Note Added: 0002100
2015-02-17 14:02 Scherub Status feedback => assigned
2015-02-17 14:12 sfernandez Note Added: 0002102
2015-02-17 14:12 sfernandez Status assigned => feedback
2015-02-17 19:15 Scherub Note Added: 0002107
2015-02-17 19:15 Scherub Status feedback => assigned
2015-07-23 02:38 jsantos Category Unity Package => Unity3D
2018-11-01 02:14 jsantos View Status public => private
2018-11-23 10:41 sfernandez View Status private => public
2018-11-23 10:41 sfernandez Platform => Any
2025-10-10 13:29 jsantos Category Unity3D => Unity