+ [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+ private delegate void AnimationProgressReachedEventCallbackType(IntPtr data);
+ private AnimationProgressReachedEventCallbackType _animationProgressReachedEventCallback;
+ private event EventHandler _animationProgressReachedEventHandler;
+ /**
+ * @brief Event for ProgressReached signal which can be used to subscribe/unsubscribe the event handler.
+ * ProgressReached signal is emitted when the Animation has reached a given progress percentage, this is set in the api SetProgressNotification.
+ */
+ public event EventHandler ProgressReached
+ {
+ add
+ {
+ if (_animationProgressReachedEventHandler == null)
+ {
+#if DEBUG_ON
+ Tizen.Log.Debug("NUI", "con1) ProgressReachedSignal().Empty = " + ProgressReachedSignal().Empty());
+ Tizen.Log.Debug("NUI", "con2) ProgressReachedSignal().GetConnectionCount = " + ProgressReachedSignal().GetConnectionCount());
+#endif
+ _animationProgressReachedEventCallback = OnProgressReached;
+ ProgressReachedSignal().Connect(_animationProgressReachedEventCallback);
+#if DEBUG_ON
+ Tizen.Log.Debug("NUI", "con3) ProgressReachedSignal().Empty = " + ProgressReachedSignal().Empty());
+ Tizen.Log.Debug("NUI", "con4) ProgressReachedSignal().GetConnectionCount = " + ProgressReachedSignal().GetConnectionCount());
+#endif
+ }
+
+ _animationProgressReachedEventHandler += value;
+ }
+ remove
+ {
+ _animationProgressReachedEventHandler -= value;
+
+ if (_animationProgressReachedEventHandler == null && ProgressReachedSignal().Empty() == false)
+ {
+#if DEBUG_ON
+ Tizen.Log.Debug("NUI", "discon1) ProgressReachedSignal().Empty = " + ProgressReachedSignal().Empty());
+ Tizen.Log.Debug("NUI", "discon2) ProgressReachedSignal().GetConnectionCount = " + ProgressReachedSignal().GetConnectionCount());
+#endif
+ ProgressReachedSignal().Disconnect(_animationProgressReachedEventHandler);
+#if DEBUG_ON
+ Tizen.Log.Debug("NUI", "discon3) ProgressReachedSignal().Empty = " + ProgressReachedSignal().Empty());
+ Tizen.Log.Debug("NUI", "discon4) ProgressReachedSignal().GetConnectionCount = " + ProgressReachedSignal().GetConnectionCount());
+#endif
+ }
+ }
+ }
+ private void OnProgressReached(IntPtr data)
+ {
+ if (_animationProgressReachedEventHandler != null)
+ {
+ //here we send all data to user event handlers
+ _animationProgressReachedEventHandler(this, null);
+ }
+ }