コード例 #1
0
        /// <summary>
        /// Closes the top menu
        /// </summary>
        protected void CollapseUp()
        {
            Menu top = ParentMenu.GetTop();

            if (top != null)
            {
                top.CloseChild();
            }
        }
コード例 #2
0
        protected virtual void OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            MenuEventArgs args = new MenuEventArgs();
            Menu          top;

            if (IsEnabled)
            {
                if (Content != null)
                {
                }
                else
                {
                    top            = ParentMenu.GetTop();
                    args.Tag       = this.ID;
                    args.Parameter = this;

                    if (top != null)
                    {
                        top.RaiseItemSelected(this, args);
                    }
                    if (!args.Cancel)
                    {
                        top.CloseChild();
                        top.ShowChild = false;
                        if (URL != null)
                        {
                            if (URL.OriginalString.Length > 0)
                            {
                                HtmlPage.Window.Navigate(URL);
                            }
                        }
                    }

                    e.Handled = true;
                }
            }
        }