View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001017 | NoesisGUI | C# SDK | public | 2017-02-15 12:05 | 2022-03-31 20:31 |
Reporter | Ziriax | Assigned To | sfernandez | ||
Priority | high | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 1.3.0 | ||||
Target Version | 2.2.0 | Fixed in Version | 2.2.0b4 | ||
Summary | 0001017: ItemsControl.ItemsSource not working with custom observable collection | ||||
Description | The following C# collection does not work when assign to ItemsControl.ItemsSource public class MyList<T> : IList, IList<T>, INotifyCollectionChanged Removing INotifyCollectionChanged makes it work, but then you don't have change notification The attached patch solves this, although I did not test the change notification yet | ||||
Tags | No tags attached. | ||||
Platform | Any | ||||
related to | 0002318 | assigned | sfernandez | ItemsControl.ItemsSource not working with IEnumerable |
ExtendRegistry.inl.patch (689 bytes)
Index: Src/Packages/Gui/CoreBindings/Src/ExtendRegistry.inl =================================================================== --- Src/Packages/Gui/CoreBindings/Src/ExtendRegistry.inl (revision 6258) +++ Src/Packages/Gui/CoreBindings/Src/ExtendRegistry.inl (working copy) @@ -112,6 +112,8 @@ { ExtendRegistry::AddInterface(type, Core::TypeOf<INotifyCollectionChanged>(), Core::CalculateParentOffset<ProxyExtendObservableList, INotifyCollectionChanged>()); + ExtendRegistry::AddInterface(type, Core::TypeOf<IList>(), + Core::CalculateParentOffset<ProxyExtendObservableList, IList>()); } typedef ProxyExtendObservableList Type; |
|
We'll fix it in a future release. I think we need to have the 3 possibilities (an IList proxy, an INotifyCollectionChanged proxy, and an IList+INotifyCollectionChanged proxy) to provide the correct solution. |
|
Ok. Now if I look at the current code in NoesisExtend.cs else if (typeof(System.Collections.IList).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo())) { if (typeof(System.Collections.Specialized.INotifyCollectionChanged).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo())) { nativeType = Noesis.ExtendObservableList.Extend(TypeFullName(type)); } else { nativeType = Noesis.ExtendList.Extend(TypeFullName(type)); } } then it seems that only those types implementing both IList and INotifyCollectionChanged will be registered as ExtendObservableList. So currently we can assume that whenever ExtendObservableList is used, the managed collection will implement IList and INotifyCollectionChanged. So I guess my patch would be sufficient for the current code base. |
|
Thanks for the patch! Sergio is going to study the integration soon. Anyway, I wonder if there is a better way to expose C# interfaces in C++, the current approach seems to be very hardcoded and limited... |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2017-02-15 12:05 | Ziriax | New Issue | |
2017-02-15 12:05 | Ziriax | File Added: ExtendRegistry.inl.patch | |
2017-02-21 13:23 | sfernandez | Note Added: 0004449 | |
2017-02-21 13:23 | sfernandez | Assigned To | => sfernandez |
2017-02-21 13:23 | sfernandez | Status | new => assigned |
2017-02-21 13:28 | Ziriax | Note Added: 0004452 | |
2017-02-21 20:33 | jsantos | Note Added: 0004469 | |
2018-11-01 02:14 | jsantos | View Status | public => private |
2018-11-22 20:06 | sfernandez | Target Version | => 2.2.0 |
2018-11-22 20:06 | sfernandez | View Status | private => public |
2018-11-22 20:06 | sfernandez | Platform | => Any |
2018-11-26 19:25 | sfernandez | Status | assigned => resolved |
2018-11-26 19:25 | sfernandez | Resolution | open => fixed |
2018-11-26 19:25 | sfernandez | Fixed in Version | => 2.2.0b4 |
2022-03-31 20:31 | aberro | Relationship added | related to 0002318 |