Exemplo n.º 1
0
        private void ExecuteSaveCommand()
        {
            BuildingModel model = new BuildingModel()
            {
                Building       = BuildingsCollection[SelectedIndex].Building,
                Amount         = Amount,
                Woodwork       = BuildingsCollection[SelectedIndex].Woodwork,
                LeftWoodwork   = BuildingsCollection[SelectedIndex].Woodwork * Amount,
                Wood           = BuildingsCollection[SelectedIndex].Wood,
                LeftWood       = BuildingsCollection[SelectedIndex].Wood * Amount,
                Stonework      = BuildingsCollection[SelectedIndex].Stonework,
                LeftStonework  = BuildingsCollection[SelectedIndex].Stonework * Amount,
                Stone          = BuildingsCollection[SelectedIndex].Stone,
                LeftStone      = BuildingsCollection[SelectedIndex].Stone * Amount,
                Smithswork     = BuildingsCollection[SelectedIndex].Smithswork,
                LeftSmithswork = BuildingsCollection[SelectedIndex].Smithswork * Amount,
                Iron           = BuildingsCollection[SelectedIndex].Iron,
                LeftIron       = BuildingsCollection[SelectedIndex].Iron * Amount
            };

            AddBuildingUIEventArgs newEventArgs =
                new AddBuildingUIEventArgs(
                    AddBuildingUIRoutedEvent,
                    "Save",
                    model
                    );

            RaiseEvent(newEventArgs);

            SelectedIndex = -1;
        }
Exemplo n.º 2
0
        private void ExecuteCancelCommand()
        {
            AddBuildingUIEventArgs newEventArgs =
                new AddBuildingUIEventArgs(
                    AddBuildingUIRoutedEvent,
                    "Cancel"
                    );

            RaiseEvent(newEventArgs);

            SelectedIndex = -1;
        }