-
Notifications
You must be signed in to change notification settings - Fork 646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[proof of concept] List lightweight styling resources #1426
base: main
Are you sure you want to change the base?
[proof of concept] List lightweight styling resources #1426
Conversation
@citelao Whoa, this is pretty amazing and super useful! Just wondering, should this live in a component page? Or should there be a dedicated 'lightweight styling' page where you could select a UI control and then see its styles? In terms of generalization: this could also be a button (next to the Documentation / Source code links) that, upon click would show all this in a dialog or flyout? That way, this logic would live in PageHeader.xaml which is a common control used for every page (and is aware of the namespace/UI control name?) |
Thanks so much for this @citelao, I'm really looking forward for this feature! In response to @niels9001 suggestions, here are my two cents: I think the lightweight styling resources should live with the control, since most developers only need this information for the one control they need. I don't think a dialog or flyout will be helpful since it should stay static to allow for easy copy and pasting of the resources. That said, I would recommend it to live in a expander, with copy buttons for each resource name. |
I strongly agree with @karkarl here: I think this UI should live in the control, since that's where developers will be looking when they lookup "button" etc. Also:
I mocked up what I hope might happen (minus copy-paste, which we should add): When you hover a brush, it's "highlighted" in the sample (by actually replacing the brush in the sample!): |
I think if we could get the actual XAML source code of WinUI 3 during runtime and go from that information. That way we could also try to get more brushes that might not be named after the control (e.g. resources that apply for multiple controls). Also have you thought about visualizing non color/brush resources? |
Today, it is very difficult to get a list of lightweight styles for a given control.
This change introduces a proof of concept that can automatically fetch a list of lightweight styles for a given control. It does this by reading the Application
ResourceDictionary
s for brushes that have the correct prefixes.Thoughts
Screenshots
Types of changes