diff --git a/MLEM.Ui/UiSystem.cs b/MLEM.Ui/UiSystem.cs
index 8439b72..6caceaa 100644
--- a/MLEM.Ui/UiSystem.cs
+++ b/MLEM.Ui/UiSystem.cs
@@ -268,6 +268,7 @@ namespace MLEM.Ui {
e.SetAreaDirty();
});
this.OnRootAdded?.Invoke(root);
+ root.OnAddedToUi?.Invoke(this);
this.SortRoots();
return root;
}
@@ -289,6 +290,7 @@ namespace MLEM.Ui {
e.SetAreaDirty();
});
this.OnRootRemoved?.Invoke(root);
+ root.OnRemovedFromUi?.Invoke(this);
}
///
@@ -417,9 +419,17 @@ namespace MLEM.Ui {
///
public Element.GenericCallback OnElementAdded;
///
- /// Even that is invoked when a is removed rom this root element of any of its children.
+ /// Event that is invoked when a is removed rom this root element of any of its children.
///
public Element.GenericCallback OnElementRemoved;
+ ///
+ /// Event that is invoked when this gets added to a in
+ ///
+ public Action OnAddedToUi;
+ ///
+ /// Event that is invoked when this gets removed from a in
+ ///
+ public Action OnRemovedFromUi;
internal RootElement(string name, Element element, UiSystem system) {
this.Name = name;