Exemple #1
0
        private void AddUnit(object sender, RoutedEventArgs e)
        {
            if (!Validate())
            {
                return;
            }

            Unit unit = new Unit(Host, name.Text, description.Text, city.SelectedValue as City, new HashSet <Amenity>(Amenities.SelectedItems), unit_type.SelectedValue as Unit.Type);

            Business.AddUnit(unit);
            UiUnits.Add(unit);

            Frame.GoBack();
        }