Exemplo n.º 1
0
 public void RemoveItem(ControlMenuItem item)
 {
     if (_addItems != null)
     {
         _addItems.Remove(item);
     }
 }
Exemplo n.º 2
0
        public void AddItem(ControlMenuItem item)
        {
            item.SetParent(this);
            if (_addItems == null)
            {
                _addItems = new ObservableCollection <ControlMenuItem>();
            }

            _addItems.Add(item);
        }
Exemplo n.º 3
0
        public bool VisibilityPanel <T>()
        {
            bool            result = false;
            ControlMenuItem cm     = Items.FirstOrDefault(x => x.TypeElement == typeof(T));

            _isVisibleItems = true;
            //VisibleItems.Execute(null);

            //foreach (var item in this.Items)
            //    if (item != cm && item.CanActive != null)
            //        item.CanActive(item);

            if (cm != null)
            {
                this.ActiveCommand.Execute(cm);
                result = true;
            }

            return(result);
        }
Exemplo n.º 4
0
        public void InsertItem(int index, ControlMenuItem item)
        {
            WindowPosition wp = WindowPositionBehaviour.GetWindowPosition(this);

            if (item.Element != null)
            {
                switch (wp)
                {
                case WindowPosition.LeftTop:
                case WindowPosition.LeftBottom:
                    wp = WindowPosition.Left;
                    break;

                case WindowPosition.RightTop:
                case WindowPosition.RightBottom:
                    wp = WindowPosition.Right;
                    break;
                }
                WindowPositionBehaviour.SetWindowPosition(item.Element, wp);
            }

            this.Items.Insert(index, item);
        }
Exemplo n.º 5
0
        public void EntryAddItem(ControlMenuItem item)
        {
            int screen = WindowPositionBehaviour.GetWindowScreen(this);

            WindowPosition wp = WindowPositionBehaviour.GetWindowPosition(this);

            WindowPosition wpe = wp;

            if (item.Element != null)
            {
                switch (wp)
                {
                case WindowPosition.LeftTop:
                case WindowPosition.LeftBottom:
                    wpe = WindowPosition.Left;
                    break;

                case WindowPosition.RightTop:
                case WindowPosition.RightBottom:
                    wpe = WindowPosition.Right;
                    break;
                }
                if (WindowPositionBehaviour.GetWindowPosition(item.Element) != WindowPosition.None)
                {
                    WindowPositionBehaviour.SetWindowPosition(item.Element, wpe);
                }

                WindowPositionBehaviour.SetWindowScreen(item.Element, WindowPositionBehaviour.GetWindowScreen(this));
            }

            this.Items.Add(item);

            PanelSettings.Build(wp, screen, this.Items.Where(x => x.Parent != null).Select(x => new PanelItemParametry()
            {
                Element = x.TypeElement, Position = wpe, Bounds = new Rect(GetStartSizeByTypePanel(x.TypeElement))
            }));
        }