UI Builder Rename Refactor

In UI Builder, when you set classes on elements and then rename the class in the editor, the associated elements don’t get their classes updated. So you get elements that have a reference to a non-existent class. Can we have refactor support for UI Builder?

1 Like

This is a request we’ve gotten a lot and that we’ve thought a lot about, but haven’t come up with a good solution yet.

Since the StyleSheets andthe VisualTreeAssets are two separate things and each can reference each other, when you rename a uss style class on an element or inside a selector, you are potentially affecting multiple files and not necessarily only the opened ones.

There are ways around this, just like an IDE would do, with specific actions like “Rename” where you get a dialog and we can show a preview of what the changes will be, but we haven’t had time to explore those yet.

Like many things, there’s often an “obvious” solution to the problem that would fix most of the cases, but would create an absolute mess in other cases.

3 Likes