As discussed in #9996 the CPListSection constructors are not fully correct, since the CPListImageRowItem can't be added to it, which is possible in the native iOS SDK.
This PR fixes that. With that, also #15622 seems to be fixed.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
Co-authored-by: Alex Soto <alex@alexsoto.me>
Co-authored-by: Chris Hamons <chris.hamons@xamarin.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
This commit is contained in:
janwiebe-jump 2022-08-22 14:04:06 +02:00 коммит произвёл GitHub
Родитель 599ae5a931
Коммит e515b5ca04
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 27 добавлений и 3 удалений

Просмотреть файл

@ -27,5 +27,7 @@ namespace ObjCRuntime {
internal const string RemovedFromChip = "This API has been removed from the 'CHIP' framework.";
internal const string BrokenBinding = "This API was incorrectly bound and does not work correctly. Use the new version indicated in the associated Obsolete attribute.";
}
}

Просмотреть файл

@ -572,11 +572,23 @@ namespace CarPlay {
[DisableDefaultCtor]
interface CPListSection : NSSecureCoding {
[Export ("initWithItems:header:sectionIndexTitle:")]
#if !XAMCORE_5_0
[Wrap ("base (true ? throw new InvalidOperationException (Constants.BrokenBinding) : NSObjectFlag.Empty)")]
[Obsolete ("Use '.ctor (ICPListTemplateItem [], string, string)' constructor instead. Warning: this will throw InvalidOperationException at runtime.")]
NativeHandle Constructor (CPListItem [] items, [NullAllowed] string header, [NullAllowed] string sectionIndexTitle);
#endif
#if !XAMCORE_5_0
[Wrap ("base (true ? throw new InvalidOperationException (Constants.BrokenBinding) : NSObjectFlag.Empty)")]
[Obsolete ("Use '.ctor (ICPListTemplateItem [], string, string)' constructor instead. Warning: this will throw InvalidOperationException at runtime.")]
NativeHandle Constructor (CPListItem [] items);
#endif
[Export ("initWithItems:header:sectionIndexTitle:")]
NativeHandle Constructor (ICPListTemplateItem [] items, [NullAllowed] string header, [NullAllowed] string sectionIndexTitle);
[Export ("initWithItems:")]
NativeHandle Constructor (CPListItem [] items);
NativeHandle Constructor (ICPListTemplateItem [] items);
[iOS (15,0), MacCatalyst (15,0)]
[Export ("initWithItems:header:headerSubtitle:headerImage:headerButton:sectionIndexTitle:")]
@ -588,8 +600,18 @@ namespace CarPlay {
[NullAllowed, Export ("sectionIndexTitle")]
string SectionIndexTitle { get; }
[Export ("items", ArgumentSemantic.Copy)]
#if !XAMCORE_5_0
[Wrap ("true ? throw new InvalidOperationException (Constants.BrokenBinding) : new NSArray ()", IsVirtual = true)]
[Obsolete ("Use 'Items2 : ICPListTemplateItem []' instead.")]
CPListItem [] Items { get; }
#endif
[Export ("items", ArgumentSemantic.Copy)]
#if !XAMCORE_5_0
ICPListTemplateItem [] Items2 { get; }
#else
ICPListTemplateItem [] Items { get; }
#endif
[iOS (14,0)]
[Export ("indexOfItem:")]