Skip to content

XamlReader doesn't set properties (for example TargetType) on FrameworkTemplates #17434

Closed

Description

@Youssef1313

Current behavior

if (type.Is<FrameworkTemplate>())
{
Func<_View?> builder = () =>
{
var contentOwner = unknownContent;
return LoadObject(contentOwner?.Objects.FirstOrDefault(), rootInstance: rootInstance) as _View;
};
var created = Activator.CreateInstance(type, builder);
if (created is FrameworkElement fe && _fileUri is not null)
{
fe.SetBaseUri(fe.BaseUri.OriginalString, _fileUri, control.LineNumber, control.LinePosition);
}
return created;
}

This doesn't handle FrameworkTemplates properly

Expected behavior

No response

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
    area/xaml-reader
    on Jul 9, 2024
  2. added theissue type on Jun 20, 2025
  3. added
    difficulty/medium 🤔
    and removed
    triage/untriaged
    difficulty/tbd
    on Sep 4, 2025
  4. github-actions commented on May 5, 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.

  5. added
    stale
    on May 5, 2026
  6. removed
    stale
    on May 5, 2026
  7. self-assigned this
    on May 5, 2026
  8. added a commit that references this issue on May 5, 2026
    2f2ec27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/xaml-readerdifficulty/medium 🤔kind/bug

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions