コード例 #1
0
            public ServerInfoPanel(ConfigPanel _pan_parent)
            {
                this.pan_parent           = _pan_parent;
                this.Background           = Brushes.White;
                AddConfigWorkGroupCommand = new RelayCommand(AddConfigWorkGroup);
                this.ContextMenu          = new ContextMenu();
                MenuItem item;

                item         = new MenuItem();
                item.Command = AddConfigWorkGroupCommand;
                item.Header  = "Add Config Work Group";
                item.Icon    = new PackIconMaterial()
                {
                    Kind = PackIconMaterialKind.FolderPlus,
                    VerticalAlignment   = VerticalAlignment.Center,
                    HorizontalAlignment = HorizontalAlignment.Center
                };
                this.ContextMenu.Items.Add(item);
            }
コード例 #2
0
        public ConfigMenuButton(ConfigPanel _pan_parent, JObject _Root, string header)
        {
            this.pan_parent = _pan_parent;
            Root            = _Root;
            this.InitStyle();

            this.Content = header;
            //this.Background = Brushes.White;
            this.Height = HEIGHT;
            this.HorizontalAlignment = HorizontalAlignment.Stretch;
            this.VerticalAlignment   = VerticalAlignment.Bottom;
            this.FontSize            = FONTSIZE;

            this.child                   = new ConfigList();
            this.child.Visibility        = Visibility.Collapsed;
            this.child.VerticalAlignment = VerticalAlignment.Top;
            this.child.parent            = this;

            this.pan_parent?.btn_group.Add(this);
            if (this.pan_parent != null)
            {
                for (int i = 0; i < this.pan_parent.btn_group.Count; i++)
                {
                    this.pan_parent.btn_group[i].Margin = new Thickness(0, i * HEIGHT, 0, (this.pan_parent.btn_group.Count - (i + 1)) * HEIGHT);
                }
            }

            AddConfigWorkGroupCommand = new RelayCommand(AddConfigWorkGroup);
            this.ContextMenu          = new ContextMenu();
            MenuItem item;

            item         = new MenuItem();
            item.Command = AddConfigWorkGroupCommand;
            item.Header  = "Add Config Work Group";
            item.Icon    = new PackIconMaterial()
            {
                Kind = PackIconMaterialKind.FolderPlus,
                VerticalAlignment   = VerticalAlignment.Center,
                HorizontalAlignment = HorizontalAlignment.Center
            };
            this.ContextMenu.Items.Add(item);
        }