The SelectedState class gives you information about what the user has selected in the app. This includes which ElementSave (that is ScreenSave, ComponentSave, or StandardElementSave)/InstanceSave/StateSave is selected.
To get the current ScreenSave:
To get the current InstanceSave: