Skip to content

[Templates] Clarification about the difference of new Items provided by Uno Extension in VS2022/VS2026 #20450

Open

Description

@DevTKSS

What would you like clarification on

We are getting those "new Item" Templates from the Uno Extension in vs 2022, but to me there is missing a concrete expaination to see the explicit usecase of each of those:

  • User Control
  • Templated Control (compared against a UserControl?)
    • which Creates a CustomControl which documentation in uno is very limited when it comes to specifics like how to bind to Commands in a mvux app with them. I tryed this and seems like I have to use mvvm just for this? I dont think that is a good practice if so...
  • Resource Dictionary with code behind (seems to me equal to Templated Control, also when should I choose this before one without code behind?)

we ony having a How To define own controls in a seperate Library Project, but what about if we just need them in the same app on different pages again? then there should be a guide telling how to add in this case the correct Resource Dictionary (there comes into play, which to choose) to the MergedDictionarys.

And which is still not named:
What about those ControlTemplate we can define in Xaml Page.Resources ? I dont think this is equal to Templated Control template, since its missing codebehind? How and where would we be able to use this? Our controls in uno apps having e.g. ItemTemplate Property, but lets say we would have now want to use a ControlTemplate we might (unknowhing how to let it bind in there to - how? - added properties?) have defined in the Page Resources? compiler was defintly not satisfyed by what I tryed so far ;)
While the ControlTemplate is indeed listed as Uno Feature, so I would expect it to be documented or even linked to a appropriate guide how to use those if you know a microsoft existing guide for it: https://platform.uno/docs/articles/supported-features.html#runtime-performance

Concern

Usage in industry

Renderer

  • Skia
  • Native

Affected platforms

Desktop (Windows), Windows App SDK

Any feedback?

I now collected this information to ResourceDictionary as simpelst of those (using some time which would be expensive in industry usage!) and trying around, but it would be good if that would be directly access able via documentation.

For example: I am planning on using Uno Apps in my future job apps with the skia or windows target with fluent or material and then there would most likly be common styles or also maybe controls that would get reused when the default ones are needing some more capabilites for the specific app usecase.
I would currently think of, it would make sense to predefine some controls, but I would not know which template as very first step I should use for this.
ResourceDict with codebehind is inheriting from ResourceDictionary... but would I use this then?
UserControl inherits from UserControl... nice, but I dont think this is eqal to ControlTemplate (?)

Maybe this should be a seperate section telling about this kind of templating?

Activity

  1. added
    triage/untriaged
    difficulty/tbd
    on May 18, 2025
  2. added
    project/documentation 📖
    and removed
    triage/untriaged
    difficulty/tbd
    on May 19, 2025
  3. MartinZikmund commented on May 19, 2025

    @MartinZikmund
    Member

    This would indeed be helpful content for our docs

  4. DevTKSS commented on May 19, 2025

    @DevTKSS
    ContributorAuthor

    @MartinZikmund thanks🎉

    I tryed same (maybe I described it wrong before) some time ago in #19156
    And also unanswered since january in a discussion: #19153

    If the content would get added to docs, would you mark #19156 also as to be closed?

    I was trying to create a Command binding to Resources Dictionary DataTemplate, or in exchange use a Control template->Custom control, but beside a utu ancestor binding to FeedView in that DataTemplate (e.g. in my UnoSamples Repository) sadly I got nothing to work which includes a Command Binding using an own record DataModel -> for an explicit x:DataType. That would be one of the targets I could think of the Custom control or those others could be the ones to use for? I tryed to type it as ICommand but when I then define elements including this for a ListFeed, this doesnt let me provide the async Valuetask🤷 I am binding from my view to (most likely because mvux binds it under the hood to the reactive VM.

    I didn't Future responded to the other issue because I do not really know how I could serve a proper sample for it as you needed me to😅

    Thinking about example usecases you could see in the mentioned Repository the Styles/Generic.xaml on the Bottom of this file is a DataTemplate for a

    • TabBarItem
      • Command binding
      • Navigation Region/Data/Request Binding

    On this I think this needs a Callback with Dependency property but as I tryed this myself I failed on the implementation of the enabled state in custom controls.

    I think for this could help a premade definition similar as uno uses as internal for the FeedViewState but as this is internal its not usable for users like me and always re defining this if I need a command in those controls or DataTemplate definitions seems not as good practice for "Dont repeat yourself"😅 principle

    • above this is "CodeSampleTextBlock"(target of the navigation request of the Tabbaritem but reused at multiple pages)
      • another TextBlock for "Description"
      • Icon -> Maybe Icon element

    On the icon is the problem in my understanding, since I would get the values for the current Textblock from Serialization of appsettings and seems like Icon Props are not supported when placing the definition in ResourcesDict, thats comlicated and unknown if this should be then c# lang for a fonticon in exchange or xaml lang🤷

    Those would be relevant to know just as examples.
    But generally some documentation to this topics could already help

  5. jeromelaban commented on May 20, 2025

    @jeromelaban
    Member

    The items found in this list are common items provided by WinUI. We're always on the fence on trying to explain pieces that Microsoft is already providing in its own WinUI documentation...

  6. DevTKSS commented on May 20, 2025

    @DevTKSS
    ContributorAuthor

    @jeromelaban thats okay, but they are just telling about async relay command, so given an mvux Szenario, to me at least its not clear from their documentation, how we would do this in uno Platform mvux🤔

    Is it meaning, when we want to define more things using those new item templates, we have to use mvvm in an mvux app? I remembering you told on discord, that while it is possible to have both side by side, its likly to cause problems. So if there could maybe be how-to for mvux Szenario and how a record would need to be defined to accept providing a ValueTask or task we regularly use for statefull methods, that could definitely help understanding this!👍
    In mvvm I would define it as ICommand maybe but in mvux thats maybe only possible with implicit command attribute or similar but no idea how would be the best practice for this then, since we do not have access like this to our vm but maybe we would like to Databind those record defined types

    And for the templated control or custom controls we can create, can you tell whats spreaking against a predefined command callback that would already encapsulate the try execute responsibility? All I found was async relay command what would bring me back to a side by side Szenario of mvvm and mvux which I failed on the registration of this because a template may not know at design time about its datacontext and this failed to update on hotreload as far as I remember. Therefore I asked for a working sample of someone who hows how to do. We currently have only a guide linking to the dependency property docs but nothing more...
    Tested this last time about December or January when I created the question

  7. jeromelaban commented on May 20, 2025

    @jeromelaban
    Member

    Got it. At this time, we do not have any item templates that make use of mvux features. It may be useful in the future, but we're not there yet.

  8. changed the title [-][Templates] Clarification about the difference of new Items provided by Uno Extension in VS2022[/-] [+][Templates] Clarification about the difference of new Items provided by Uno Extension in VS2022/VS2026[/+] on Dec 29, 2025
  9. Jen-Uno commented on Mar 6, 2026

    @Jen-Uno
    Contributor

    Validation update (2026-03-05): I reviewed this on branch fix/algolia-docsearch-duplicates-and-layout (PR #22789). This issue still persists / is not resolved by the current branch changes. Tracking and consolidation: #22788.

  10. MartinZikmund commented on May 18, 2026

    @MartinZikmund
    Member

    Summarizing the thread for clarity: the items shown in this menu are the standard WinUI item templates from Visual Studio (not Uno-specific), which is why we tend not to duplicate Microsoft's documentation on them. As Jerome mentioned, we don't currently ship MVUX-flavored item templates, though it's something we may revisit in the future. I'll keep this open under our documentation backlog so we can consider adding a short note clarifying the distinction (WinUI templates vs. Uno-specific templates) and pointing MVUX users to the appropriate patterns. Thanks for raising it!

  11. github-actions commented on Oct 29, 2026

    @github-actions
    Contributor

    This issue has had no activity for 120 days. It will be closed in 10 days if there is no further activity. Remove the Stale label or leave a comment to keep it open.

  12. added
    stale
    on Oct 29, 2026
  13. removed
    stale
    on Nov 6, 2026
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

    kind/documentationproject/documentation 📖

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions