public ObservableCollection <ItemViewModel> GetPushes() { return(new ObservableCollection <ItemViewModel> { ItemViewModelFactory.FromPush(new NotePush { Title = "Push 1", Body = "Push text", Type = PushbulletPushType.Note }), ItemViewModelFactory.FromPush(new LinkPush { Title = "Push 2", Url = "www.pushbullet.com", }), ItemViewModelFactory.FromPush(new ListPush()), ItemViewModelFactory.FromPush(new AddressPush { Address = "Content", }), ItemViewModelFactory.FromPush(new FilePush { FileName = "Push 5", FileUrl = "DL link", }), }); }
public ObservableCollection <ItemViewModel> GetPushes() { EnsureClient(); var pushesModel = new ObservableCollection <ItemViewModel>(); PushbulletPushes pushes = _client.GetPushes(); foreach (ActivePush push in pushes.Pushes.OfType <ActivePush>().OrderByDescending(push => push.CreatedRaw)) { pushesModel.Add(ItemViewModelFactory.FromPush(push)); } return(pushesModel); }