private void UpdateShadow(ShadowBase shadow, bool needToListenStateChanged) { ControlStateChangeEventInternal -= OnControlStateChangedForShadow; if (shadow == null) { Tizen.NUI.Object.SetProperty(swigCPtr, View.Property.SHADOW, new PropertyValue()); } else { Tizen.NUI.Object.SetProperty(swigCPtr, View.Property.SHADOW, shadow.ToPropertyValue(this)); } if (needToListenStateChanged) { ControlStateChangeEventInternal += OnControlStateChangedForShadow; } }
private void OnControlStateChangedForShadow(object obj, ControlStateChangedEventArgs controlStateChangedInfo) { var boxShadowSelector = (Selector <Shadow>)GetValue(BoxShadowSelectorProperty); if (boxShadowSelector != null) { ShadowBase prevShadow = boxShadowSelector.GetValue(controlStateChangedInfo.PreviousState); var boxShadow = boxShadowSelector.GetValue(controlStateChangedInfo.CurrentState); if (boxShadow == prevShadow) { return; } Tizen.NUI.Object.SetProperty(swigCPtr, View.Property.SHADOW, boxShadow == null ? new PropertyValue() : boxShadow.ToPropertyValue(this)); return; } var imageShadowSelector = (Selector <ImageShadow>)GetValue(ImageShadowSelectorProperty); if (imageShadowSelector != null) { ShadowBase prevShadow = imageShadowSelector?.GetValue(controlStateChangedInfo.PreviousState); var imageShadow = imageShadowSelector.GetValue(controlStateChangedInfo.CurrentState); if (imageShadow == prevShadow) { return; } Tizen.NUI.Object.SetProperty(swigCPtr, View.Property.SHADOW, imageShadow == null ? new PropertyValue() : imageShadow.ToPropertyValue(this)); } }
private void OnBoxShadowChanged(ShadowBase instance) { BoxShadow = (Shadow)instance; }
private void OnImageShadowChanged(ShadowBase instance) { ImageShadow = (ImageShadow)instance; }
private void ApplyShadow() { ShadowBase shadow = (boxShadow != null && !boxShadow.IsEmpty()) ? (ShadowBase)boxShadow.GetValue() : (ShadowBase)imageShadow?.GetValue(); Tizen.NUI.Object.SetProperty(swigCPtr, Interop.ViewProperty.View_Property_SHADOW_get(), ShadowBase.ToPropertyValue(shadow, this)); }