Skip to content

ToolkitSampleMultipleChoiceOption broken #76

Open

Description

@Avid29

Describe the bug

The ToolkitSampleMultiChoiceOption is unable to parse data.

The error
image

The sample choices
image

The sample XAML
image

Steps to reproduce

Use https://github.com/Avid29/Labs-Windows/tree/marquee

Expected behavior

The strings should be parsed for XAML binding

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

This is breaking my PR for CommunityToolkit/Labs-Windows#275

Help us help you

No, I'm unable to contribute a solution.

Activity

  1. Arlodotexe commented on Feb 24, 2023

    @Arlodotexe
    Member

    @niels9001 I think you made changes here recently, any idea?

  2. niels9001 commented on Feb 24, 2023

    @niels9001
    Collaborator

    @Arlodotexe @Avid29 CommunityToolkit/Labs-Windows#336 introduced changes in this space.

    @Avid29 We now have the NumericOption (see example in the PR above) and is more appropriate. Could you try that to see if that works?

  3. Avid29 commented on Feb 24, 2023

    @Avid29
    MemberAuthor

    @niels9001 I will try it for speed, however the RepeatBehavior is still broken and requires the Multi-Choice

  4. niels9001 commented on Feb 24, 2023

    @niels9001
    Collaborator

    @niels9001 I will try it for speed, however the RepeatBehavior is still broken and requires the Multi-Choice

    See https://github.com/CommunityToolkit/Labs-Windows/blob/main/components/SegmentedControl/samples/SegmentedControlBasicSample.xaml.cs#L12

    To parse strings to enum a concerting method is required. See the XAML/CS in the above file as a sample.

  5. Avid29 commented on Feb 24, 2023

    @Avid29
    MemberAuthor

    RepeatBehavior is not an enum

  6. niels9001 commented on Feb 24, 2023

    @niels9001
    Collaborator

    RepeatBehavior is not an enum

    Yeah, my point was that you might need to convert it manually.. (from string to x). See the previous example.

    Might be the same for the speed stuff.. could be that it's parsed as a string, but your control asks for a double. Adding a function to convert should solve that (or using the NumericOption which is more appropriate)

  7. michael-hawker commented on Feb 24, 2023

    @michael-hawker
    Member

    This seems related to this feature request I had added I think? CommunityToolkit/Labs-Windows#149

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛Something isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions