Skip to content

Port (Framework)Extensions #6

Open

Description

@niels9001

TODO

### Base Porting Checklist
- [x] Component/package name (`CommunityToolkit.WinUI.Extensions`)
- [x] Namespace `CommunityToolkit.WinUI`
- [x] Merge differences from UWP main to WinAppSDK / Uno forks
- [x] Import original doc or setup new doc
- [ ] Needs a refresh/update, and probably split
- [x] Samples
- [ ] Tests
- [ ] All brought over tests pass for UWP/WinAppSDK
- [ ] https://github.com/CommunityToolkit/Windows/issues/134
- [x] Support for WASM via Uno Platform
### Extensions
- [x] FrameworkElementExtensions
- [x] ListViewExtensions
- [x] BitmapIconExtension
- [x] BitmapIconSourceExtension
- [x] EnumValuesExtension
- [x] FontIconExtension
- [x] FontIcoNSourceExtension
- [x] NullableBoolExtension
- [x] OnDeviceExtension
- [x] SymbolIconExtension
- [x] SymbolIconSourceExtension
- [x] MatrixExtensions
- [x] RectExtensions
- [x] RotateTransformExtensions
- [x] SkewTransformExtensions
- [x] TranslateTransformExtensions
- [x] ScrollViewExtensions
- [x] TextBoxExtensions
- [ ] TitleBarExtensions (Blocked: Missing WinUI APIs)
- [ ] ElementExtensions (Blocked: Missing WinUI APIs)
- [ ] ApplicationViewExtensions (Blocked: Missing WinUI APIs)
- [ ] WebViewExtensions (Deprecate in favor of `WebView2`)
- [x] PointExtensions
- [x] RectExtensions
- [x] SizeExtensions
- [x] StringExtensions
- [x] HyperlinkExtensions
- [x] DependencyObjectExtensions
- [x] DispatcherQueueExtensions
### Known issues
### Future improvements
## Notable Changes
- [ ] For FrameworkExtensions, look at https://github.com/CommunityToolkit/Labs-Windows/blob/main/components/SegmentedControl/src/Helpers/FrameworkElementExtensions.cs. Some changes were made that to trigger the extension upon loading.

Activity

  1. michael-hawker commented on Mar 21, 2023

    @michael-hawker
    Member

    @niels9001 originally we did a big push in 7.0 to flatten the namespace and remove 'extensions' so they were all consistent across the package for easy usage.

    Context:

    We could have the component/package maybe be called Extensions if we change the scope of what's inside it, but may want to think about still having a base namespace for some of these things?

    @Sergio0694 thoughts?

  2. Sergio0694 commented on Mar 21, 2023

    @Sergio0694
    Member

    Heyoooooo I see a new repo 👀👀👀

    @michael-hawker Yeah, if we went back and added "Extensions" back it'd be a bit weird.
    FWIW we also don't use "Extensions" in the .NET Community Toolkit.

  3. michael-hawker commented on Mar 22, 2023

    @michael-hawker
    Member

    Looking at the template that Niels copied I think he may have just used Namespace to mean package/component name? But will clarify in a quick-sync tomorrow. 🙂

  4. niels9001 commented on Mar 22, 2023

    @niels9001
    CollaboratorAuthor

    @Sergio0694 @michael-hawker Oh yeah, I basically just replaced the last bit of namespace from the previous template. So please ignore / update 😄!

  5. michael-hawker commented on Mar 22, 2023

    @michael-hawker
    Member

    Haha, yeah, I guess that line was a bit more specific to the Converters as they are in their own namespace anyway. (Maybe that's a separate discussion as to if they should remain there.)

    Anyway, all good. We'll sort it out and can update these issues all together at our next sync.

  6. michael-hawker commented on Mar 22, 2023

    @michael-hawker
    Member

    #4 also needs the WeakEventListener and DispatcherQueue extensons. So we should port those over as well into the general base helpers/extensions place.

    Should we have the extensions and helpers together as like a common folder/component name?

  7. moved this to 🏗 In progress in Toolkit 8.xon Mar 22, 2023
  8. michael-hawker commented on Mar 22, 2023

    @michael-hawker
    Member

    We have some extensions in the base Microsoft.Toolkit.Uwp package merging those in with the extensions of Microsoft.Toolkit.Uwp.UI package here.

    Then will create a separate Helpers component I think that contains most of the rest?

  9. michael-hawker commented on Mar 22, 2023

    @michael-hawker
    Member

    Currently have not brought over:

    • ApplicationViewExtensions
    • TitleBarExtensions
    • ScrollViewerExtensions.MiddleClickScrolling
    • WebViewExtensions

    I believe the top two work differently in UWP vs. WinAppSDK, so probably need to look at more closely if it makes sense to have them. Also, I believe @niels9001 has some thoughts about Titlebar helpers in general we should investigate for a revamp, especially with the platform doing work to better enable custom titlebars, see microsoft/microsoft-ui-xaml#8137

    The Middle Click Scrolling extensions are dependent on Windowing APIs, Input APIs, and Cursor APIs, which all work very differently between UWP and Windows App SDK, so not porting for now, as I don't think they work for Windows App SDK at the moment, so probably need more attention.

    With WebView2 now, we should figure out if we need to remap these extensions or how that should work.

  10. moved this from 🏗 In progress to 👀 In review in Toolkit 8.xon Apr 11, 2023
  11. hoshiizumiya commented on Jan 10, 2026

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

Metadata

Metadata

Type

No type

Projects

  • Status
    👀 In review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions