Exemplo n.º 1
0
        private Image CreateImage(Classes.Item item, int GridRow, int GridColumn)
        {
            Image IMGItemImage = new Image();

            IMGItemImage.HorizontalAlignment = HorizontalAlignment.Stretch;
            IMGItemImage.VerticalAlignment   = VerticalAlignment.Stretch;
            IMGItemImage.Source  = item.Image;
            IMGItemImage.Stretch = Stretch.Fill;
            Grid.SetRow(IMGItemImage, GridRow);
            Grid.SetColumn(IMGItemImage, GridColumn);
            return(IMGItemImage);
        }
Exemplo n.º 2
0
        private TextBlock CreateTextBlock(Classes.Item item, int GridRow, int GridColumn)
        {
            TextBlock TBItemInfo = new TextBlock();

            TBItemInfo.TextWrapping        = TextWrapping.WrapWholeWords;
            TBItemInfo.HorizontalAlignment = HorizontalAlignment.Stretch;
            TBItemInfo.VerticalAlignment   = VerticalAlignment.Stretch;
            TBItemInfo.Text     = "Name: " + item.Name + "\nCost: " + item.Cost + "\nPower: " + item.Power + "\nCount: " + item.Count;
            TBItemInfo.FontSize = 13;
            Grid.SetRow(TBItemInfo, GridRow);
            Grid.SetColumn(TBItemInfo, GridColumn);
            return(TBItemInfo);
        }
Exemplo n.º 3
0
        private void BTItemButton_Click(object sender, RoutedEventArgs e, Classes.Item Item)
        {
            Button temp = sender as Button;

            if (User.Gold >= Item.Cost)
            {
                User.Gold          -= Item.Cost;
                User.GoldPerSecond += Item.Power;
                Item.Count         += 1;
                Item.Cost           = Convert.ToSingle(Math.Round(Item.Cost * 1.15f));
                temp.Tag            = Item.Cost;
                LoadItems(null, null);
            }
        }
Exemplo n.º 4
0
        private Button CreateButton(Classes.Item item, int GridRow, int GridColumn)
        {
            Button BTItemButton = new Button();

            BTItemButton.Content             = "Click!";
            BTItemButton.HorizontalAlignment = HorizontalAlignment.Stretch;
            BTItemButton.VerticalAlignment   = VerticalAlignment.Stretch;
            BTItemButton.Background          = new SolidColorBrush(Colors.SkyBlue);
            BTItemButton.Click += (sender, e) => BTItemButton_Click(sender, e, item);
            BTItemButton.Tag    = item.Cost;
            Grid.SetRow(BTItemButton, GridRow);
            Grid.SetColumn(BTItemButton, GridColumn);
            return(BTItemButton);
        }