void Update() { if (_ControlOSAPaddingAtInsetEdge == ControlOSAPaddingMode.ADAPTIVE) { if (_OSA == null || !_OSA.IsInitialized) // make sure adapter wasn't disposed { return; } var rect = _RT.rect; var li = _OSA.GetLayoutInfoReadonly(); double mySize = rect.size[li.hor0_vert1]; if (_MyLastKnownSize != mySize) { SetPadding(mySize); _OSA.ScheduleForceRebuildLayout(); } } }
void Update() { if (_ControlOSAPaddingAtInsetEdge == ControlOSAPaddingMode.ADAPTIVE) { if (_OSA == null || !_OSA.IsInitialized) // make sure adapter wasn't disposed { return; } var rect = _RT.rect; var li = _OSA.GetLayoutInfoReadonly(); double mySize = rect.size[li.hor0_vert1]; // Update OSA's padding when either the decorator's size changes or when OSA's own padding is externally changed if (_LastKnownInset != _Inset || _MyLastKnownSize != mySize || !IsSamePadding(_OSALastKnownPadding, _OSA.BaseParameters.ContentPadding)) { SetPadding(mySize); _OSA.ScheduleForceRebuildLayout(); } } }