private async Task Initialize() { try { //LuoVols = await _dataService.GetVolList(); //var item = await _dataService.GetData(); HeartVM = new HeartViewModel(); await HeartVM.RestoreListAsync(); //DataVM = new VolDataViewModel(this, new VolService(Request.GetAllVol_w, NormalFactory, CtsFactory)); LuoVolTags = LuoVolFactory.GetVolTagList(); LuoVolNums = LuoVolFactory.GetVolNumList(); DataVM = new VolDataViewModel(this, new VolService(Request.GetNumVol_w(LuoVolNums[_currentNumIndex].KeySrc), NormalFactory, CtsFactory)); DataVM.RefreshAsync(); TagDataVM = new VolDataViewModel(this, new VolService(Request.GetTagVol_w(LuoVolTags[_currentTagIndex].Name), NormalFactory, CtsFactory)); TagDataVM.RefreshAsync(); SetPlayerCookie(); var timer = new DispatcherTimer(); timer.Interval = new TimeSpan(0, 0, 6); timer.Tick += Timer_Tick; timer.Start(); } catch (Exception ex) { // Report error here } }
public VolService(string url, LuoVolFactory factory, CancellationTokenSourceFactory ctsFactory) : base(factory, ctsFactory) { RequestUrl = url; }
public Task <ObservableCollection <LuoVol> > GetVolList() { return(LuoVolFactory.getlist()); }