Rapid-XAML-Toolkit
Rapid-XAML-Toolkit copied to clipboard
Add the ability to extract styles from an element
When the properties of an element have been changed it would be great to be able to extract those values to a style that can then easily be applied to other elements.
#SuggestedAtBuild
This is a great idea and manipulating styles is a wonderful way of working with the XAML Analysis capabilities.
Analyzing styles is already documented as #138 but this would be a great way to begin work in this area.
My initial thought is to extract the style to the document level until support the ability to work with multiple files (#136)
Need to consider/define:
- What element to apply this to. Can it be all?
- Which properties of those elements?
- How to name the generated styles? and how to avoid naming collisions?
If extract at the file-level, it also makes sense to be able to group the ability to apply a style from the file to an element in that file.
Individual parser, therefore, needs to know about resources in that file. This will necessitate a new capability within an XamlElementProcessor.
Automatically applying a created style to other elements in the same file can initially be a two-step process. Extracting the resource and automatically applying it everywhere can be a future task.