Silverlight 2 End to End教程:建立Digg搜尋用戶端

來源:互聯網
上載者:User

Part0 Silverlight 2 End to End系列教程:建立Digg搜尋用戶端

       

翻譯人:ttzhang(Technology Life)
翻譯時間:2008/10/24  22:02:59
作者:ScottGu
出處:ScottGu's Blog

         

Silverlight 2 End to End Tutorial: Building a Digg Search Client

Silverlight 2 End to End系列教程:建立Digg搜尋用戶端      

To help people come up to speed with Silverlight 2, I've written a simple Silverlight application and put together a series of step by step tutorials that explain the different programming concepts behind it (controls, layout management, networking, data-binding, styles, user controls, templates, etc). I also added a tutorial post that demonstrates how to migrate the application outside of the browser and enable it to run as a desktop application using WPF and the full .NET Framework.

為了協助大家快速跟上Silverlight2,我已經寫了一個簡單Silverlight程式,並把一步一步學習的教程放在一個系列中,來向大家解釋其中不同的編程概念(控制項、布局管理、網路通訊、資料繫結、樣式、使用者控制項、模板等等)。另外,我也發布了一個怎樣把Silverlight應用遷移到瀏覽器之外的樣本教程,使用WPF和.NET Framework 讓Silverlight應用像傳統型應用程式一樣運行。

下面是我整理在一起的該系列的8個教程的連結:

注意:由於此部分教程已經存在中文版,所以本人從本篇教程起停止翻譯,並在上面添加了英文和中文翻譯的串連。

  • Part 0: Introduction

     (【中文版】 第零部分:簡介)

        Part 1: Creating "Hello World" with Silverlight 2 and VS 2008

       (【中文版】 第一部分:使用Silverlight 2 和 VS 2008建立“Hello World”程式 )

  • Part 2: Using Layout Management

       (【中文版】 第二部分:使用布局管理 (木野狐譯) )

  • Part 3: Using Networking to Retrieve Data and Populate a DataGrid

       (【中文版】 第三部分:使用 Networking取回資料並填充DataGrid)

        Part 4: Using Style Elements to Better Encapsulate Look and Feel

       (【中文版】 第四部分:使用 Style 元素更好地封裝觀感 (木野狐譯))

        Part 5: Using the ListBox and DataBinding to Display List Data

       (【中文版】 第五部分:用 ListBox 和 DataBinding 顯示列表資料 (木野狐譯))

        Part 6: Using User Controls to Implement Master/Details Scenarios

       (【中文版】 第六部分:使用使用者控制項實現主從表情境)

  • Part 7: Using Templates to Customize Control Look and Feel

       (【中文版】 第七部分:使用控制項範本定製控制項的觀感 )

  • Part 8: Creating a Digg Desktop Version of our Application using WPF

       (【中文版】 第八部分:使用WPF建立一個Digg案頭應用 )

 

The application I've built the tutorials around is a simple search front end to the popular Digg.com site, and allows users to type in search topics and browse Digg stories that match them.

我已經建立的這個程式是一個基於流行網站Digg.com的簡單搜尋前端,它允許我們輸入搜尋主題,瀏覽符合搜尋主題的DiggStory。

<Download Code> Click here to download a completed version of the Digg client sample. </Download Code>

<Download Code>點擊這裡下載Digg用戶端樣本的完整原始碼. </Download Code>

   

All of the UI in the application is built using Silverlight's built-in WPF UI framework. The application uses the Silverlight networking stack and cross-domain access support to query the Digg REST API directly, and uses LINQ and LINQ to XML to query/transform the returned data into DiggStory objects that I databind the UI against:

  1. 程式中全部的UI都是使用Silverlight中內建的WPF UI Framework建立的。程式使用Silverlight的多種網路和跨域訪問的支援直接查詢DiggREST API,並且使用了LINQ 和LINQ to XML來查詢/轉換返回的資料為我在資料繫結到UI上的DiggStory對象:

       

       

    The application supports a master/details data interaction model that allows users to select stories from the search list and quickly drill into more details about them. A user can jump to the Digg article directly from the details form, or close it and pick another story to drill into:

    這個程式支援"主/詳細"資料互動的模型,允許使用者從搜尋列表選擇Stories,並快速顯示他們的更詳細的資訊。在詳細資料表單,使用者可以直接跳轉到Digg上的文章,或者關閉這個表單並選擇查看另外一個Story的詳細資料。

       

       

    The entire application is implemented in about 35 lines of C# code and 75 lines of XAML page/user-control markup. It only uses controls and libraries built-into Silverlight.

    整個程式執行大約35行C#代碼和75行XAML 頁面/使用者控制項標記。它只使用了Silverlight內建的控制項和類庫。

    <Download Code> Click here to download a completed version of the Digg client sample. </Download Code>

    <Download Code>點擊這裡下載Digg用戶端樣本的完整原始碼. </Download Code>

       

    If you have used WPF before the UI concepts I discuss in the tutorial series will all be very familiar. If you haven't used WPF before, the tutorials should provide a good overview of the fundamental programming concepts in it, and hopefully provide you with the basic knowledge necessary to start building either Silverlight 2 or WPF applications.

    如果你以前使用過WPF,那麼你對我在這個系列教程中談到的UI概念就會非常熟悉。如果你以前沒有使用過WPF,這個教程應該會讓你對它的基本編程概念有一個很好的瞭解,也希望能為你開始建立Silverlight 2 或者WPF應用程式提供必要的基本知識。

       

    這是我第一次翻譯文章,有很多地方翻譯的不好,希望園子裡的朋友多多指點和支援!我會在接下來的二天裡,把這8篇文章的翻譯發到這裡,請大家關注!

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.