Tooling-Windows-Submodule icon indicating copy to clipboard operation
Tooling-Windows-Submodule copied to clipboard

ToolkitSampleMultipleChoiceOption broken

Open Avid29 opened this issue 2 years ago • 7 comments

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.

Avid29 avatar Feb 24 '23 16:02 Avid29

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

Arlodotexe avatar Feb 24 '23 16:02 Arlodotexe

@Arlodotexe @Avid29 https://github.com/CommunityToolkit/Labs-Windows/pull/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?

niels9001 avatar Feb 24 '23 16:02 niels9001

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

Avid29 avatar Feb 24 '23 17:02 Avid29

@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.

niels9001 avatar Feb 24 '23 17:02 niels9001

RepeatBehavior is not an enum

Avid29 avatar Feb 24 '23 17:02 Avid29

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)

niels9001 avatar Feb 24 '23 17:02 niels9001

This seems related to this feature request I had added I think? https://github.com/CommunityToolkit/Labs-Windows/issues/149

michael-hawker avatar Feb 24 '23 21:02 michael-hawker