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

Multiple ToolkitBoolOptions causes crash #20

Closed
2 of 20 tasks
niels9001 opened this issue Feb 6, 2023 · 0 comments · Fixed by #37
Closed
2 of 20 tasks

Multiple ToolkitBoolOptions causes crash #20

niels9001 opened this issue Feb 6, 2023 · 0 comments · Fixed by #37
Assignees
Labels

Comments

@niels9001
Copy link
Collaborator

Describe the bug

There seems to be an issue that whenever defining two ToolkitBoolOptions the source generator throws an error. Seems that whenever the second bool is bind to it crashes. Probably due to changes made in: CommunityToolkit/Labs-Windows#336

<labs:SettingsExpander IsExpanded="{x:Bind IsCardEnabled, Mode=OneWay}"/>

This works:

[ToolkitSampleBoolOption("IsCardEnabled", true, Title = "Is Enabled")]
[ToolkitSampleBoolOption("IsCardExpanded", false, Title = "Is Expanded")]

This does not (see change in order):

[ToolkitSampleBoolOption("IsCardExpanded", false, Title = "Is Expanded")]
[ToolkitSampleBoolOption("IsCardEnabled", true, Title = "Is Enabled")]

Tested with two ToolkitTextOptions and that seemed to work fine.

System.InvalidOperationException: Sequence contains no matching element at System.Linq.Enumerable.First[TSource](IEnumerable1 source, Func2 predicate) at SettingsControlsExperiment.Samples.SettingsExpanderSample.get_IsCardEnabled() in C:\Repos\Labs-Windows\labs\SettingsControls\samples\SettingsControls.Samples\CommunityToolkit.Labs.Core.SourceGenerators\CommunityToolkit.Labs.Core.SourceGenerators.ToolkitSampleOptionGenerator\SettingsControlsExperiment.Samples.SettingsExpanderSample.Property.IsCard

@Arlodotexe FYI

Steps to reproduce

- Open the SettingsControls experiment on main
- Run samples, navigate to "SettingsExpanderSample"
- Crash

Expected behavior

Not crash

Screenshots

No response

Code Platform

  • UWP
  • WinAppSDK / WinUI 3
  • Web Assembly (WASM)
  • Android
  • iOS
  • MacOS
  • Linux / GTK

Windows Build Number

  • Windows 10 1809 (Build 17763)
  • Windows 10 1903 (Build 18362)
  • Windows 10 1909 (Build 18363)
  • Windows 10 2004 (Build 19041)
  • Windows 10 20H2 (Build 19042)
  • Windows 10 21H1 (Build 19043)
  • Windows 11 21H2 (Build 22000)
  • Other (specify)

Other Windows Build number

No response

App minimum and target SDK version

  • Windows 10, version 1809 (Build 17763)
  • Windows 10, version 1903 (Build 18362)
  • Windows 10, version 1909 (Build 18363)
  • Windows 10, version 2004 (Build 19041)
  • Other (specify)

Other SDK version

No response

Visual Studio Version

No response

Visual Studio Build Number

No response

Device form factor

No response

Additional context

No response

Help us help you

Yes, but only if others can assist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
3 participants