Skip to content

Port Converters #2

@michael-hawker

Description

@michael-hawker

TODO

### 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!
## 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)
## Prerequisites
- [ ] https://github.com/microsoft/microsoft-ui-xaml/issues/8287
## Future Improvements
- [ ] P2: Central x:Bind helper class that leverages shared logic of converters?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority-1components::convertersCommonly used converters that allow the data to be modified as it passes through the binding engine.enhancementNew feature or request

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions