I have a script that creates a temporary component when loading data. The Component gets marked on creation with HideFlags.DontSaveInBuild | HideFlags.DontSaveInEditor.
I have an extra editor window in which I load/configure/save this temporary component. Until now I used a propertyfield and ApplyModifiedPropertiesWithoutUndo on the serialized object created from the temporary component. I use withoutUndo because otherwise unity would mark my scene dirty, even though the only change is to a component marked with dontsave.
Now I want to recreate this editor window with UIToolkit, but I’m struggling with this point. I’ve tried binding the required property of the so to the propertyfield and editing works fine, but I can’t seem to find a way to stop unity from marking my scene dirty. The Bind/PropertyField seems to automatically create undos (even though the component is still marked with dontSave). I’d be fine with having undos (even though they aren’t particularly useful in this case) but I don’t want the scene marked dirty when there are actually no changes to save. How would I go about doing this with UIToolkit?