Exemple #1
0
        /// <summary>
        /// A new dweller has just been created. Set it up
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BuildingCreated(object sender, IBuilding building)
        {
            // create a control to display the info
            BasicBuildingInfoControl infoControl = new BasicBuildingInfoControl {
                DataContext = new BasicBuildingViewModel(building)
            };

            // add to the animation panel
            var tile = new SimpleAnimationHostTile {
                PositionalObject = building as IPositionalObject, Control = infoControl
            };

            tile.ActualPositionChanged += Tile_ActualPositionChanged;
            Panel.AddControl(tile);
        }
Exemple #2
0
        /// <summary>
        /// A new dweller has just been created. Set it up
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DwellerCreated(object sender, IRoamingDweller dweller)
        {
            // create a control to display the info
            BasicDwellerInfoTile infoControl = new BasicDwellerInfoTile {
                DataContext = new BasicDwellerViewModel(dweller)
            };

            // add to the animation panel
            var tile = new SimpleAnimationHostTile {
                PositionalObject = dweller as IPositionalObject, Control = infoControl
            };

            tile.ActualPositionChanged += Tile_ActualPositionChanged;
            Panel.AddControl(tile);
        }