It would be useful to query the left, right, top and bottom margins of a 9 patch object in cases where the object is being re-scaled to envelop another object. For example, if you have a picture frame that you want to resize to fit various sprite images, or if you have a custom UI element that uses the 9 patch to frame a progress bar. The 9 patch must be resized to take into account its own margins, but there is no way to see what the margins are at runtime. It would be handy to do something like this pseudo code: 9slice.Width = Object.Width+9slice.MarginLeft+9slice.MarginRight
Exposing these properties as read-only would prevent the need for magic numbers and redundant instance variables to store the margins.