Rapid-XAML-Toolkit icon indicating copy to clipboard operation
Rapid-XAML-Toolkit copied to clipboard

Add the ability to extract styles from an element

Open mrlacey opened this issue 5 years ago • 2 comments

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

mrlacey avatar May 13 '19 17:05 mrlacey

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?

mrlacey avatar May 13 '19 18:05 mrlacey

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.

mrlacey avatar Sep 15 '19 13:09 mrlacey