- Home
- Products
- Integration
- Tutorial
- Barcode FAQ
- Purchase
- Company
Microsoft Silverlight 3: A Beginner s Guide in .NET framework
Microsoft Silverlight 3: A Beginner s Guide QR Code Creation In Visual Studio .NET Using Barcode printer for ASP.NET Control to generate, create QR Code image in ASP.NET applications. Bar Code Drawer In .NET Using Barcode printer for ASP.NET Control to generate, create bar code image in ASP.NET applications. To create an RSS reader using Silverlight 3, create a new Silverlight project using Visual Studio 2010 Next, right-click the Silverlight project in the Solution Explorer and select Add Reference Scroll to and select the SystemServiceModelSyndication namespace Design the Pagexaml file to include a method of collecting the feed URL and a button to trigger the request Additionally, include a TextBlock or other control for displaying the feed results The sample XAML is shown in the following markup: Print Quick Response Code In Visual C# Using Barcode printer for VS .NET Control to generate, create Quick Response Code image in Visual Studio .NET applications. Painting Denso QR Bar Code In .NET Using Barcode generation for .NET framework Control to generate, create QR Code ISO/IEC18004 image in .NET framework applications. <UserControl x:Class="L0602Page" xmlns="http://schemasmicrosoftcom/winfx/2006/xaml/presentation" xmlns:x="http://schemasmicrosoftcom/winfx/2006/xaml" Width="573" Height="343"> <Canvas x:Name="LayoutRoot"> <CanvasBackground> <LinearGradientBrush EndPoint="0282999992370605,0155000001192093" StartPoint="0717000007629395,0845000028610229"> <GradientStop Color="#FFAA9563"/> <GradientStop Color="#FFFFFFFF" Offset="0527"/> </LinearGradientBrush> </CanvasBackground> <TextBlock Height="Auto" Width="Auto" CanvasLeft="8" CanvasTop="8" Text="Enter the URL for the RSS feed to acquire below" TextWrapping="Wrap" x:Name="tbHeading"/> <TextBox Height="Auto" Width="428" CanvasLeft="8" CanvasTop="34537" Text="" TextWrapping="Wrap" x:Name="txtURL"/> <Button Height="20772" Width="125" CanvasLeft="440" CanvasTop="34537" Content="Acquire Feed" x:Name="btnAcquire" Click="btnAcquire_Click" /> <ScrollViewer Height="275691" Width="557" CanvasLeft="8" CanvasTop="59309" x:Name="svResults" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"> <TextBlock Height="Auto" Width="Auto" Text="no feed results to display" TextWrapping="Wrap" x:Name="tbResults"/> </ScrollViewer> </Canvas> </UserControl> QR Code JIS X 0510 Creator In Visual Basic .NET Using Barcode drawer for VS .NET Control to generate, create QR image in .NET framework applications. UPC-A Supplement 5 Printer In Visual Studio .NET Using Barcode creation for ASP.NET Control to generate, create UPC A image in ASP.NET applications. The results of the preceding markup, as displayed in Internet Explorer 8, are shown in Figure 6-5 Code 128 Code Set A Creator In VS .NET Using Barcode creator for ASP.NET Control to generate, create Code 128 image in ASP.NET applications. Encode Data Matrix ECC200 In VS .NET Using Barcode generation for ASP.NET Control to generate, create Data Matrix image in ASP.NET applications. 6: UCC-128 Creator In .NET Framework Using Barcode printer for ASP.NET Control to generate, create EAN128 image in ASP.NET applications. Painting EAN13 In .NET Using Barcode drawer for ASP.NET Control to generate, create European Article Number 13 image in ASP.NET applications. Communicating with the Outside World
Barcode Encoder In VS .NET Using Barcode generation for ASP.NET Control to generate, create bar code image in ASP.NET applications. USPS PLANET Barcode Generation In .NET Framework Using Barcode maker for ASP.NET Control to generate, create USPS PLANET Barcode image in ASP.NET applications. Figure 6-5 Painting Matrix 2D Barcode In Java Using Barcode printer for Java Control to generate, create Matrix Barcode image in Java applications. Making Data Matrix 2d Barcode In Visual Basic .NET Using Barcode maker for .NET Control to generate, create ECC200 image in Visual Studio .NET applications. The Silverlight RSS feed reader display
Painting Bar Code In VB.NET Using Barcode generator for Visual Studio .NET Control to generate, create barcode image in VS .NET applications. Print EAN / UCC - 13 In None Using Barcode creator for Online Control to generate, create EAN-13 Supplement 5 image in Online applications. Silverlight 3 ships with a class designed for working with syndication feeds the SystemServiceModelSyndicationSyndicationFeed class However, prior to you working with a feed using the SyndicationFeed class, the feed contents must first be requested, read into memory, and parsed into the correct format Furthermore, when a syndication feed is requested, a cross-domain call is being made, so the server where the feed resides must have a CrossDomainxml file in place to allow a cross-domain request The upcoming code listing illustrates asynchronously requesting the contents of a feed, parsing the feed contents into XML, and loading the contents into a SyndicationFeed class An additional step must be taken to display the results When the request is made for the feed contents and the callback method is invoked, the callback method is functioning in the context of a background worker thread The background worker thread is used when networking requests are being handled The Silverlight user interface is managed using a separate thread of execution, commonly referred to as the UI thread Silverlight prevents attempts in the background worker thread from directly interacting with the UI thread Hence, it will be difficult or impossible to directly update the Silverlight UI from the callback method that handles the loading and parsing of the syndication feed contents Creating Code 3/9 In VB.NET Using Barcode creator for Visual Studio .NET Control to generate, create USS Code 39 image in Visual Studio .NET applications. Make European Article Number 13 In None Using Barcode generation for Software Control to generate, create EAN-13 image in Software applications. Microsoft Silverlight 3: A Beginner s Guide
Print Data Matrix ECC200 In None Using Barcode generator for Excel Control to generate, create Data Matrix 2d barcode image in Excel applications. Make UPC-A In Objective-C Using Barcode maker for iPhone Control to generate, create GS1 - 12 image in iPhone applications. Silverlight 3 includes a class called the Dispatcher class that is used to communicate between Silverlight threads If the Dispatcher class is not used and an attempt is made to directly update the UI thread from the background worker thread, Silverlight will throw an exception, stating that unauthorized cross-thread access has been attempted The following well-documented code listing illustrates a request for syndication feed contents: using using using using using using using using using using using using using using System; SystemCollectionsGeneric; SystemLinq; SystemNet; SystemWindows; SystemWindowsControls; SystemWindowsDocuments; SystemWindowsInput; SystemWindowsMedia; SystemWindowsMediaAnimation; SystemWindowsShapes; SystemXml; SystemServiceModel; SystemServiceModelSyndication; namespace L0602 { public partial class Page : UserControl { // create an instance to represent the uri Uri uri; public Page() { InitializeComponent(); } /// <summary> /// this method makes the request /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnAcquire_Click(object sender, RoutedEventArgs e) { // store the URL of the feed uri = new Uri(txtURLText); // create a request 6: Communicating with the Outside World
HttpWebRequest request = (HttpWebRequest)HttpWebRequest Create(uri); // make the request requestBeginGetResponse(new AsyncCallback(displayFeed), request); } /// <summary> /// this method handles the callback /// </summary> /// <param name="asyncResult">the result of the request /// </param> void displayFeed(IAsyncResult asyncResult) { // nab the request HttpWebRequest request = (HttpWebRequest) asyncResult AsyncState; // nab the response HttpWebResponse response = (HttpWebResponse)requestEndGetResponse(asyncResult); // parse the response to xml XmlReader reader = XmlReaderCreate(response GetResponseStream()); // load the feed SyndicationFeed feed = SyndicationFeedLoad(reader); // call to the UI thread to update the UI DispatcherBeginInvoke(delegate { // clear the results textblock tbResultsText = ""; // display the feed items foreach (SyndicationItem item in feedItems) { tbResultsText += itemTitleText + Environment NewLine; } }); } } }
|
|