/// <summary> /// Возвращает экземпляр класса EventManager /// </summary> /// <returns>Экземпляр класса EventManager</returns> static public EventManagerBD GetInstance() { if (instance == null) { instance = new EventManagerBD(); } return(instance); }
private async void StartParse() { parser = new ParserForNewFrontend("https://concertinfo.ru/"); IsLoading = true; Events = await parser.ParseAsync(); if (Events == null) { Events = await EventManagerBD.GetInstance().LoadDataAsync(); } IsLoading = false; FilterOptions.Locations = new List <string>(Events.Select((ev) => ev.Location).Distinct()); Sort(); }
public DataViewModel(FilterOptions fo) { FilterOptions = fo; FilterOptions.SubmitFilters = new RelayCommand(() => Sort()); SortedEvents = new ObservableCollection <Event>(); Events = new List <Event>(); ClearSearchText = new RelayCommand(() => SearchText = ""); Synchronize = new RelayCommand(async() => { if (IsSynchronizing) { return; } IsSynchronizing = true; await EventManagerBD.GetInstance().SynchronizeAsync(Events); IsSynchronizing = false; }); StartParse(); }