Skip to content

ContentPresenter.ContentTemplateRoot should not be public #16148

Closed

Description

@ramezgerges

Current behavior

It's public for no reason. Only ContentPresenter makes calls to it.

Expected behavior

Make it private.

How to reproduce it (as minimally and precisely as possible)

No response

Workaround

No response

Works on UWP/WinUI

None

Environment

No response

NuGet package version(s)

No response

Affected platforms

No response

IDE

No response

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

Activity

  1. added
    kind/bug
    triage/untriaged
    difficulty/tbd
    on Apr 5, 2024
  2. added
    kind/breaking-change 💥
    and removed
    kind/bug
    on Apr 5, 2024
  3. added
    difficulty/starter 🚀
    and removed
    triage/untriaged
    difficulty/tbd
    on Jul 16, 2024
  4. github-actions commented on Aug 18, 2025

    @github-actions
    Contributor

    Hey there — just a heads-up that this issue has been quiet for over a year. If there’s no update or comment in the next 10 days, it’ll be closed automatically. Feel free to remove the stale label or drop a note to keep it open.

  5. added
    stale
    on Aug 18, 2025
  6. removed
    stale
    on Aug 19, 2025
  7. github-actions commented on May 2, 2026

    @github-actions
    Contributor

    This issue has had no activity for 120 days. It will be closed in 10 days if there is no further activity. Remove the Stale label or leave a comment to keep it open.

  8. added
    stale
    on May 2, 2026
  9. removed
    stale
    on May 4, 2026
  10. github-actions commented on Sep 2, 2026

    @github-actions
    Contributor

    This issue has had no activity for 120 days. It will be closed in 10 days if there is no further activity. Remove the Stale label or leave a comment to keep it open.

  11. added
    stale
    on Sep 2, 2026
  12. removed
    stale
    on Sep 6, 2026
  13. MartinZikmund commented on Nov 8, 2026

    @MartinZikmund
    Member

    Thanks for raising this. ContentPresenter.ContentTemplateRoot was reduced to internal in #23748 and made private in #24187, as you can see here:

    private View ContentTemplateRoot
    {
    get
    {
    return _contentTemplateRoot;
    }
    set
    {
    var previousValue = _contentTemplateRoot;
    if (previousValue != null)
    {
    CleanupView(previousValue);
    UnregisterContentTemplateRoot();
    UpdateContentTransitions(this.ContentTransitions, null);
    }
    _contentTemplateRoot = value;
    if (_contentTemplateRoot != null)
    {
    RegisterContentTemplateRoot();
    UpdateContentTransitions(null, this.ContentTransitions);
    }
    ReportContentTemplateRootToTemplatedParent();
    }
    }
    . This is on master and ships in 7.0, and ContentControl.ContentTemplateRoot remains the public way to read the template root. If you still see a problem with this, please open a new issue.

    This was checked as part of an AI-assisted backlog review by reading the code, not by running it. If it looks wrong, please reply and we will take another look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty/starter 🚀kind/breaking-change 💥

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions