public void SetSelectedItemCase(InventoryBoxRuntime ClickedBox) { foreach (InventoryBoxRuntime InventoryBox in ContainerItems.Children) { InventoryBox.CurrentVariableState = InventoryBoxRuntime.VariableState.Default; } ClickedBox.CurrentVariableState = InventoryBoxRuntime.VariableState.Selected; }
public void SetSelectedItemCase(int ItemIndex) { foreach (InventoryBoxRuntime InventoryBox in ContainerItems.Children) { InventoryBox.CurrentVariableState = InventoryBoxRuntime.VariableState.Default; } SelectedBox = ContainerItems.Children[ItemIndex] as InventoryBoxRuntime; SelectedBox.CurrentVariableState = InventoryBoxRuntime.VariableState.Selected; }
public void PlaceCasesInInventoryPanel(int NbOfCases, int NbOfCols) { var container = this.GetGraphicalUiElementByName("ContainerItems") as ContainerRuntime; for (int i = 0; i < NbOfCases; i++) { var box = new InventoryBoxRuntime(); //box.Width = (float)(container.GetAbsoluteWidth() / NbOfCols); box.Name = box.GetType().ToString() + i.ToString(); box.BoxIndex = i; container.Children.Add(box); } AffectEvents(); }