Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Putting ComboBox into BreadcrumbBar crashes the app #10116

Open
xperiandri opened this issue Oct 29, 2024 · 1 comment
Open

Putting ComboBox into BreadcrumbBar crashes the app #10116

xperiandri opened this issue Oct 29, 2024 · 1 comment

Comments

@xperiandri
Copy link

xperiandri commented Oct 29, 2024

Describe the bug

      <BreadcrumbBar ItemsSource="{x:Bind ViewModel.Path, Mode=OneWay}">
        <BreadcrumbBar.Template>
          <DataTemplate x:DataType="slf:FloorItemViewModel">
            <BreadcrumbBarItem Content="{Binding}">
              <BreadcrumbBarItem.ContentTemplate>
                <DataTemplate x:DataType="slf:FloorItemViewModel">
                  <ComboBox />

Putting a ComboBox in any form crashes the app.
But if you replace UI with a ComboBox later it works

Steps to reproduce the bug

  1. Create BeadcrumbBar as described above
  2. Run

Expected behavior

No crash

Screenshots

No response

NuGet package version

WinUI 3 - Windows App SDK 1.6.1: 1.6.240923002

Windows version

Windows 11 (24H2): Build 26100.2033

Additional context

No response

@xperiandri xperiandri added the bug Something isn't working label Oct 29, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Oct 29, 2024
@xperiandri
Copy link
Author

Workaround is

<DataTemplate x:DataType="slf:FloorItemViewModel">
  <Grid>
    <i:Interaction.Behaviors>
      <ic:EventTriggerBehavior EventName="Loaded">
        <ic:ChangePropertyAction TargetObject="{Binding ElementName=FloorsSelector}" PropertyName="Visibility" Value="Visible"/>
      </ic:EventTriggerBehavior>
    </i:Interaction.Behaviors>
    <ComboBox x:Name="FloorsSelector" x:DeferLoadStrategy="Lazy"
            ItemsSource="{Binding Items}"
            IsTextSearchEnabled="True"
            PlaceholderText="Select floor"
            SelectedValuePath="Name"
            SelectedItem="{Binding SelectedItem, Mode=TwoWay}">
      <ComboBox.ItemTemplate>
        <DataTemplate x:DataType="domain:BuildingFloor">
          <TextBlock Text="{x:Bind Name}" />
        </DataTemplate>
      </ComboBox.ItemTemplate>
    </ComboBox>
  </Grid>
</DataTemplate>

x:DeferLoadStrategy="Lazy" + trigger

@karkarl karkarl added area-Binding area-Breadcrumb Regression and removed needs-triage Issue needs to be triaged by the area owners labels Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants