Ejemplo n.º 1
0
        public UnitView(AoAUnitViewModel unitVM)
        {
            InitializeComponent();
            DataContext = unitVM;
            DescriptionBox.Document = DM.Armory.BL.EugenStringConverter.MakeFlowDocument(unitVM.Description, Brushes.LightGreen);

            foreach (AoATurretViewModel turretVM in unitVM.Turrets)
            {
                foreach (AoAWeaponViewModel weaponVM in turretVM.Weapons)
                {
                    WeaponView view = new WeaponView(weaponVM);
                    WeaponsList.Children.Add(view);
                }
            }

            foreach (AoAResearchViewModel up in unitVM.Upgrades)
            {
                IconView view = new IconView(up);
                ResearchesList.Children.Add(view);
            }

            foreach(AoAUnitViewModel unit in unitVM.Children)
            {
                IconView view = new IconView(unit);
                UpgradesList.Children.Add(view);
            }
        }
Ejemplo n.º 2
0
 public IconView(AoAUnitViewModel model)
 {
     InitializeComponent();
     unit = model;
     DataContext = model;
     Tile.Click += UnitOpen;
 }