public void createWindowsToast(AmazonItem item) { ToastContent content = new ToastContent() { Launch = item.productURL, ActivationType = ToastActivationType.Protocol, Visual = new ToastVisual() { BindingGeneric = new ToastBindingGeneric() { Children = { new AdaptiveText() { Text = item.productTitle }, new AdaptiveText() { Text = "The item is available at " + item.productPrice + ", at or lower than the desired price " + item.desiredPrice + "." } }, Attribution = new ToastGenericAttributionText() { Text = "Via Amazon Price Tracker" }, } }, }; var toast = new ToastNotification(content.GetXml()); ToastNotificationManager.CreateToastNotifier().Show(toast); }
private async Task <object> updateAmazonItemsList() { ObservableCollection <AmazonItem> dummList = new ObservableCollection <AmazonItem>(); _ = await getAmazonItemsAsync(); if (AmazonItems != null) { foreach (AmazonItem item in AmazonItems) { List <String> itemProperties = await getAmazonItemFromURLAsync(item.productURL); AmazonItem newItem; if (itemProperties != null) { newItem = new AmazonItem(itemProperties[0], itemProperties[1], item.desiredPrice, itemProperties[2], itemProperties[3]); newItem.previousPrice = item.productPrice; dummList.Add(newItem); } } AmazonItems = dummList; await storeAmazonItemsAsync(); } return(null); }