public void CreateEvent() { Event newEvent = new Event(eventVM.Id, eventVM.Name, eventVM.Description, eventVM.Place, DateTimeConverter.DateTimeOffsetAndTimeSetToDateTime(eventVM.Date, eventVM.Time)); EventCatalogSingleton.Instance.AddEvent(newEvent); PersistencySercive.GemDataTilAsync(); }
public EventViewModel() { DateTime dt = System.DateTime.Now; Date = new DateTimeOffset(dt.Year, dt.Month, dt.Day, 0, 0, 0, 0, new TimeSpan()); Time = new TimeSpan(dt.Hour, dt.Minute, dt.Second); SingletonRef = EventCatalogSingleton.Instance; EventHandler = new MyEventHandler(this); CreateEventCommand = new RelayCommand(EventHandler.CreateEvent); PersistencySercive.HentDataTilDiskAsync(); DeleteEventCommand = new RelayCommand(DeleteSelected, IsListEmptyCheck); // DeleteEventCommand = new RelayArgCommand<Event>( ev => EventHandler.DeleteEvent(ev)); }
public void DeleteEvent(Event ev) { EventCatalogSingleton.Instance.RemoveEvent(ev); PersistencySercive.GemDataTilAsync(); }