Exemple #1
0
        private void AddItem_Click(object sender, EventArgs e)
        {
            this.AdminSplitContainer.Panel2.Controls.Clear();
            var itemUserControl = new ItemUserControl();

            this.AdminSplitContainer.Panel2.Controls.Add(itemUserControl);
        }
Exemple #2
0
        public void PopulateInventory(Item[] items)
        {
            GrdInventory.Children.Clear();
            GrdInventory.RowDefinitions.Clear();
            int s = 0;

            for (int i = 0; i < items.Length; i++)
            {
                Item item = items[i];
                if (item.ItemQuantity <= 0)
                {
                    continue;
                }
                ItemUserControl itemUserControl = new ItemUserControl(item, this);
                RowDefinition   rowDefinition   = new RowDefinition();
                rowDefinition.Height = new GridLength(50, GridUnitType.Pixel);
                GrdInventory.RowDefinitions.Add(rowDefinition);
                GrdInventory.Children.Add(itemUserControl);
                Grid.SetRow(itemUserControl, s);
                s++;
            }
        }
Exemple #3
0
        private void viewItemToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ItemUserControl item = new ItemUserControl();

            AddControlsToPanel(item);
        }