Example #1
0
        void ContentMenu_EventHandler(object sender, HtmlEventArgs e)
        {
            Rect bounds = AgControlBase.GetSLBounds(this);

            if (bounds.Contains(new Point(e.ClientX, e.ClientY)))
            {
                e.PreventDefault();
                e.StopPropagation();
                this.ContextMenu.SetLocation(new Point(e.OffsetX, e.OffsetY));
                this.ContextMenu.IsDropDownOpen = true;
            }
        }
        public static Rect GetSLBounds(FrameworkElement item)
        {
            Point pos = AgControlBase.GetSilverlightPos(item);

            return(new Rect(pos, new Size(item.ActualWidth, item.ActualHeight)));
        }