示例#1
0
        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));
        }
示例#3
0
 public void DeleteEvent(Event ev)
 {
     EventCatalogSingleton.Instance.RemoveEvent(ev);
     PersistencySercive.GemDataTilAsync();
 }