maui icon indicating copy to clipboard operation
maui copied to clipboard

Custom Control ItemTemplate fails to change at runtime in MAUI iOS

Open prathameshnarkhede opened this issue 1 year ago • 1 comments

Description

When I create Custom Control on top of ListView and try to change ItemTemplate at runtime, The ListView does not get new ItemTemplate in iOS.

Steps to Reproduce

  1. Create Custom control over a TemplatedView with a Collection Property and ItemTemplate Property.
  2. Create a ContentPage implementing Custom control and Add DataTemplate to it.
  3. Add ControlTemplate with ListView to Page.
  4. Add Elements to ListView.
  5. Create Button on ContentPage to control ItemTemplate of the Custom Control.
  6. In Custom Control, Add logic to get ListView from TemplatedChild and apply the ItemTemplate on Property change of ItemTemplate.

Expected: ListView ItemTemplate Changes to newly applied ItemTemplate on Windows, Android and iOS platforms. Observed: ListView ItemTemplate Changes to newly applied ItemTemplate on Windows and Android but not on iOS.

Link to public reproduction project repository

https://github.com/prathameshnarkhede/mauiiositemtemplatebug.git

Version with bug

9.0.0-preview.7.24407.4

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

prathameshnarkhede avatar Aug 28 '24 17:08 prathameshnarkhede

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

github-actions[bot] avatar Aug 28 '24 17:08 github-actions[bot]

I can repro this issue at iOS platform on the latest 17.12.0 Preview 1.0(9.0.0-preview.7.24407.4 & 8.0.72).

jaosnz-rep avatar Aug 29 '24 09:08 jaosnz-rep

Does it work if you use CollectionView @prathameshnarkhede ?

PureWeen avatar Aug 29 '24 22:08 PureWeen

@PureWeen I tried changing from ListView to CollectionView and that worked for me. Thanks for suggestion.

prathameshnarkhede avatar Aug 30 '24 23:08 prathameshnarkhede