Пример #1
0
        private Image CreateImage(Classes.Upgrade upgrade, int GridRow, int GridColumn)
        {
            Image IMGItemImage = new Image();

            IMGItemImage.HorizontalAlignment = HorizontalAlignment.Stretch;
            IMGItemImage.VerticalAlignment   = VerticalAlignment.Stretch;
            IMGItemImage.Source  = new BitmapImage(new Uri("ms-appx:///Assets/Square44x44Logo.scale-200.png"));//needs replacement
            IMGItemImage.Stretch = Stretch.Fill;
            Grid.SetRow(IMGItemImage, GridRow);
            Grid.SetColumn(IMGItemImage, GridColumn);
            return(IMGItemImage);
        }
Пример #2
0
        private TextBlock CreateTextBlock(Classes.Upgrade upgrade, int GridRow, int GridColumn)
        {
            TextBlock TBItemInfo = new TextBlock();

            TBItemInfo.TextWrapping        = TextWrapping.WrapWholeWords;
            TBItemInfo.HorizontalAlignment = HorizontalAlignment.Stretch;
            TBItemInfo.VerticalAlignment   = VerticalAlignment.Stretch;
            TBItemInfo.Text     = "Name: " + upgrade.Name + "\nCost: " + upgrade.Cost + "\nPower: " + upgrade.Power + "\nCount: " + upgrade.Count;
            TBItemInfo.FontSize = 13;
            Grid.SetRow(TBItemInfo, GridRow);
            Grid.SetColumn(TBItemInfo, GridColumn);
            return(TBItemInfo);
        }
Пример #3
0
        private void BTItemButton_Click(object sender, RoutedEventArgs e, Classes.Upgrade Upgrade)
        {
            Button temp = sender as Button;

            if (User.Gold >= Upgrade.Cost)
            {
                User.Gold         -= Upgrade.Cost;
                User.GoldPerClick += Upgrade.Power;
                Upgrade.Count     += 1;
                Upgrade.Cost       = Convert.ToSingle(Math.Round(Upgrade.Cost * 1.15f));
                temp.Tag           = Upgrade.Cost;
                LoadUpgrades(null, null);
            }
        }
Пример #4
0
        private Button CreateButton(Classes.Upgrade upgrade, 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, upgrade);
            BTItemButton.Tag    = upgrade.Cost;
            Grid.SetRow(BTItemButton, GridRow);
            Grid.SetColumn(BTItemButton, GridColumn);
            return(BTItemButton);
        }