Skip to content

Combobox binding issue in ContentControl #8843

Open

Description

Describe the bug

In a ContentControl, when the binded Content changes, the ComboBox SelectedItem in the DataTemplate is set to NULL as well as the binded property in the model.

It happens only when the DataTemplate returned by the DataTemplateSelector remains the same.

This issue was not present in WPF.

Steps to reproduce the bug

Clone the repository.

Run the project WinUISample

  1. Click on Expense 1 (Category A is selected)
  2. Click on Expense 2 (Category B is selected)
  3. Click on Expense 1 (Category is null)

When the DataTemplate changes the category remains

  1. Click on Expense 4 (Category A is selected)
  2. Click on Expense special (Category B is selected, DataTemplate is different)
  3. Click on Expense 4 (Category A is selected)
  4. Selecting Expense 3 will set Category to null on Expense 4

Expected behavior

The category need to stay on the right value.

The WPFSample included in the solution implementing the same logic works as expected.

Screenshots

No response

NuGet package version

Windows App SDK 1.4.0: 1.4.230822000

Packaging type

No response

Windows version

Windows 11 version 22H2 (22621, 2022 Update)

IDE

Visual Studio 2022

Additional context

No response

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

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions