Skip to content

Different behavior of DataTemplateSelector with enabled and disabled trim function #10302

@M-Muluc

Description

@M-Muluc

Describe the bug

trim removes the code section used in WinUI to modify DataTemplate

protected override DataTemplate? SelectTemplateCore(object item, DependencyObject container)
{
    // some code
}

Steps to reproduce the bug

  1. Enable trim and build project (in the attached repository trim is already enabled in the release and disabled in debug)

code

Expected behavior

Trim function does not delete used code sections.

Screenshots

Debug build:

2025-01-15.180449.mp4

Release build:

2025-01-15.180208.mp4

NuGet package version

None

Windows version

Windows 11 (24H2): Build 26100

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-triageIssue needs to be triaged by the area owners

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions