CommunityToolkit / CommunityToolkit/Windows

Port Converters

Open
#2 2 comments 0 reactions 0 assignees View on GitHub
components::converters enhancement Priority-1
Dominant language
C#
Stars
1.1k
Forks
166
PR merge metrics
No merged PRs in 30d

Description

## TODO

```[tasklist]
### Base Porting Checklist
- [x] Update namespace (to `CommunityToolkit.WinUI.Converters`)
- [ ] Merge differences from UWP main to WinAppSDK, Uno Platform fork
- [x] Import original doc or setup new doc
- [ ] Needs a refresh/update, and probably split
- [ ] https://github.com/CommunityToolkit/Windows/issues/133
- [ ] Brought over existing unit tests from main repo (**did not** compare or merge with WinUI branch **nor** update to use our helpers)
- [x] All brought over tests pass for UWP/WinAppSDK
- [ ] https://github.com/CommunityToolkit/Windows/issues/132
- [ ] Support for WASM via Uno Platform (Had trouble testing due to https://github.com/CommunityToolkit/Tooling-Windows-Submodule/issues/24)
- [ ] ResourceNameToResourceStringConverter definitely needs to be compared
- [x] `StringFormatConverter` from first sample worked fine!
```

```[tasklist]
## Converters
- [x] BoolNegationConverter
- [x] BoolToObjectConverter
- [x] BoolToVisibilityConverter
- [x] CollectionVisibilityConverter
- [x] ColorToDisplayNameConverter
- [x] DoubleToObjectConverter
- [x] DoubleToVisibilityConverter
- [x] EmptyCollectionToObjectConverter
- [x] EmptyObjectToObjectConverter
- [x] EmptyStringToObjectConverter
- [x] FileSizeToFriendlyStringConverter
- [x] FormatStringConverter
- [x] ResourceNameTOResourceStringConverter
- [x] StringFormatConverter
- [x] StringVisibilityConverter
- [x] TaskResultConverter
- [x] TypeToObjectConverter
- [x] VisibilityToBoolConverter
```

## Notable Changes

- Changed `FormatStringConverter` to `IFormattableToStringConverter` to differentiate from `StringFormatConverter` (too confusing to have such a similar name)

```[tasklist]
## Prerequisites
- [ ] https://github.com/microsoft/microsoft-ui-xaml/issues/8287
```

```[tasklist]
## Future Improvements
- [ ] P2: Central x:Bind helper class that leverages shared logic of converters?
```

Contributor guide

Open the contributing guide

Research direction

Start by comparing the existing UWP main and WinUI branch implementations with the Uno Platform fork under the CommunityToolkit.WinUI.Converters namespace. Review the brought-over unit tests and the linked issues, especially for ResourceNameToResourceStringConverter and WASM support. Done means the outstanding checklist items are resolved and the converter tests pass across the supported targets.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
frontend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.