microsoft / microsoft/microsoft-ui-xaml

Proposal: Can we have a shortcut to create a copy of ControlTemplate?

Open
#10,431 0 comments 13 reactions 0 assignees View on GitHub
area-Tooling feature proposal team-Controls
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

# Proposal: Can we have a shortcut to create a copy of ControlTemplate?

## Summary
We understand it might be difficult to implement a working xaml preview/editor. (althought it's already 5 years after #2975) But can we have a shortcut to quickly create a copy of a control's `ControlTemplate`, that is like the single most important feature of xaml preview?

## Rationale
So I am trying to modify a small ui detail of `NavigationView`, so I go to `packages`, find `generic.xaml`, and find the `NavigationView`'s `ControlTemplate` by searching `TargetType="NavigationView`, and I found none. Then I tried `DefaultNavigationView`, still none.
Then after wasting for several minutes of my life to scroll the 36000 lines of xml , I found it under this
```xml

<Setter Property="PaneToggleButtonStyle" Value="{StaticResource PaneToggleButtonStyle}" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="CompactPaneLength" Value="{ThemeResource NavigationViewCompactPaneLength}" />
<Setter Property="CornerRadius" Value="{ThemeResource OverlayCornerRadius}" />
<Setter Property="Template">
```
First of all, why does it still have a useless `controls:` prefix after like 4 years since winui2?

And why can't we have nice things? Why can't we just have a feature in visual studio that I can quickly edit a controltemplate when I right click on the control's xml?

![Image](https://github.com/user-attachments/assets/5cc3b9b8-7bf4-44b3-8c44-9f3d617c5d23)

<!----------------------
The below sections are optional when submitting an idea or proposal.
All sections are required before we'll accept a PR to main, but aren't necessary to start the discussion.
------------------------>

## Scope
<!-- Please include a list of what the feature should and shouldn't do by filling in the table below.
'Must' implies that the feature should not ship without this capability.
'Should' is something we should push hard for, but is not absolutely required to ship.
'Could' is a nice-to-have; a good stretch goal that isn't painful if we don't achieve it.
'Won't' is a clear statement that the proposal/feature will intentionally not have that capability.
This list will evolve and grow as the proposal becomes more refined over time.
A good rule of thumb is to start your proposal with no more than 7 high-level requirements.
-->
| Capability | Priority |
| :---------- | :------- |
| This proposal will allow developers to quickly edit the ControlTemplate of a built-in control | Must |

## Important Notes
<!-- Please include any other important details.
This could include one or more of:
- usage examples
- an API proposal (any supported language or pseudocode is fine)
- design mockups or example screenshots
- other implementation notes
-->

## Open Questions
<!-- Please list any open issues that you think still need to be addressed.
These could include areas you think would benefit from community or WinUI team input -->

Contributor guide

Open the contributing guide

Research direction

Start by reviewing packages/generic.xaml, especially the NavigationView style and its ControlTemplate, along with the earlier XAML preview/editor discussion in #2975. The proposal is not implementation-ready: the team would first need to define the shortcut's scope and acceptance criteria before a contributor could identify the relevant entry point.

Written by the indexing model from the issue text.

Assessment

Domain
desktop
Issue type
Feature
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.