Пример #1
0
        /// <summary>
        /// For this object bind Parent object.Init handle and all kinds of EvasObjectEvent.
        /// </summary>
        /// <param name="parent">Parent object.</param>
        /// <since_tizen> preview </since_tizen>
        public void Realize(EvasObject parent)
        {
            if (!IsRealized)
            {
                Parent = parent;
                Handle = CreateHandle(parent);
                Debug.Assert(Handle != IntPtr.Zero);

                (parent as Window)?.AddChild(this);

                OnRealized();
                _deleted = new EvasObjectEvent(this, EvasObjectCallbackType.Del);
                _keydown = new EvasObjectEvent <EvasKeyEventArgs>(this, RealHandle, EvasObjectCallbackType.KeyDown, EvasKeyEventArgs.Create);
                _keyup   = new EvasObjectEvent <EvasKeyEventArgs>(this, RealHandle, EvasObjectCallbackType.KeyUp, EvasKeyEventArgs.Create);
                _moved   = new EvasObjectEvent(this, EvasObjectCallbackType.Move);
                _resized = new EvasObjectEvent(this, EvasObjectCallbackType.Resize);

                _deleted.On += (s, e) => MakeInvalidate();
            }
        }