|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Xml;
using RSSReader;
using RSSReader.RSSService;
namespace RSSReader
{
public partial class UC_RSSReader : UserControl
{
#region Constructor
public UC_RSSReader()
{
InitializeComponent();
}
#endregion
#region Event Handler
private void FetchRSS_Click(object sender, RoutedEventArgs e)
{
if (!string.IsNullOrEmpty(RSSFeedUrlTextBox.Text.Trim())
&& Uri.IsWellFormedUriString(RSSFeedUrlTextBox.Text.Trim(), UriKind.Absolute))
{
LoadingTextBlock.Visibility = Visibility.Visible;
RSSFeed.Items.Clear();
RSSReaderServiceClient RSSReaderServiceClient = new RSSReaderServiceClient();
RSSReaderServiceClient.GetFeedCompleted += new EventHandler<GetFeedCompletedEventArgs>(RSSReaderServiceClient_GetFeedCompleted);
RSSReaderServiceClient.GetFeedAsync((new Uri(RSSFeedUrlTextBox.Text)).ToString());
}
}
void RSSReaderServiceClient_GetFeedCompleted(object sender, GetFeedCompletedEventArgs e)
{
RSSFeed.ItemsSource = e.Result;
LoadingTextBlock.Visibility = Visibility.Collapsed;
}
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I have been working in different .NET Technologies like ASP.NET,WPF,Silverlight for the last few years.I am enjoying my life as a Programmer and spending time with my Family,Friends & Camera.
My Technical Blog
My Photo Blog