Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ContentPresenter is not clearing its default Content binding when Content is TemplatedBinded in xaml #22027

@polqnaP

Description

@polqnaP

Description

Create a custom TemplatedView with property Content (type object) and property MyView (type view).
Whenever Content changes, populate the MyView with a view to your liking.
In the TemplatedView's ControlTemplate use ContentPresenter with its Content TemplateBinded to MyView.
Change the TemplatedView's content at runtime.
Instead of the MyView a default Label is displayed inside the TemplatedView.

contentPresenter_contentissue

Steps to Reproduce

  1. Run the provided sample project
  2. Click the button to change the Content of a custom TemplatedView.

Expected Behavior
The MyView View should be displayed in the ContentPresenter.

Actual Behavior
Instead of the MyView being displayed, a Label is displayed.

Link to public reproduction project repository

https://github.com/telerik/ms-samples/tree/main/Maui/ContentPresenterConverterIssue

Version with bug

8.0.3 GA

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android, Windows, macOS

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-layoutStackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenterpartnerIssue or Request from a partner teampartner/syncfusionIssues / PR's with Syncfusion collaborationplatform/androidplatform/iosplatform/macosmacOS / Mac Catalystplatform/windowss/triagedIssue has been revieweds/try-latest-versionPlease try to reproduce the potential issue on the latest public versions/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions