public Manteinance(HotelHandler Hotel) { InitializeComponent(); _internalHotel = Hotel; dateTimePickerStart.MinDate = DateTime.Today; dateTimePickerEnd.MinDate = DateTime.Today.AddDays(1); }
/// <summary> /// Constructor af Hotel og initialiserer Commandoer /// </summary> public HotelViewModel() { HotelCatalogSingleton = HotelCatalogSingleton.Instance; HotelHandler = new HotelHandler(this); _newHotel = new Hotel(); //Create CreateHotelCommand = new RelayCommand(HotelHandler.CreateHotel); //Delete _deleteHotelCommand = new RelayCommand(HotelHandler.DeleteHotel, SelectedIndexIsSet); //Update _updateHotelCommand = new RelayCommand(HotelHandler.UpdateHotel, SelectedIndexIsSet); }
public HotelVM() { _consumerHotel = ConsumerCatalog.GetConsumer <Hotel>(); _hotelHandler = new HotelHandler(this); _newHotel = new Hotel(); _pressPostCommand = new RelayCommand(_hotelHandler.PostNewHotel, () => !_hotelHandler.IdExist()); _pressPutCommand = new RelayCommand(_hotelHandler.PutNewHotel, _hotelHandler.IdExist); _pressDeleteCommand = new RelayCommand(_hotelHandler.DeleteHotel, _hotelHandler.IdExist); _pressClearCommand = new RelayCommand(_hotelHandler.Clear); TableVisibility = Visibility.Collapsed; HotelCatalog = CatalogSingleton <Hotel> .Singleton; if (HotelCatalog.IsLoading) { TableVisibility = Visibility.Visible; HotelCatalog.Subscribe(() => { TableVisibility = Visibility.Collapsed; OnPropertyChanged(nameof(TableVisibility)); OnPropertyChanged(nameof(OppositeTableVisibility)); }); } }