Beispiel #1
0
        public Size Draw(Point offset, BoxConstraint constraint, UIContext context)
        {
            var size = Child.Draw(offset, constraint, context);

            if (EventHandler != null)
            {
                // simply wraps the child bounds in an area event handler
                context.AddEventHandler(new UIContext.AreaEventHandlerRegistration()
                {
                    Area = new Rectangle
                    {
                        Location = offset,
                        Size     = size,
                    },
                    Handler = EventHandler,
                });
            }

            return(size);
        }