FLASH論壇-Flash之神魂顛倒Microsoft 應用技術區Microsoft Silverlight 銀光專區 → [轉帖]銀光+LINQ+WCF 範例(三)

MSDN 研討會資料下載 熱門租屋行情 網路行銷秘訣大公開 磷蝦油=比魚油更強 Microsoft Silverlight
減肥診所 雷射抽脂 ASP.NET完全攻略與快速上手 買墨水送神幣喔 貸款
近視雷射手術 電波拉皮 隆乳 胎毛筆 當鋪
投影機 生日禮物 借錢 調整型內衣 白蟻
氣球 眼袋 虛擬主機神魂特惠 大陸新娘 NCCU集中營
網頁設計 愛情城市 保險套 液晶電視

  共有1612人閱讀過本文章折疊列印

主題:[轉帖]銀光+LINQ+WCF 範例(三)

帥哥喲,離線,有人找我嗎?
ruok
  1樓 個人化首頁 | 個人資料 | 搜尋 | EMAIL | 首頁 | |

加到: FunP 書籤加到: 黑米書籤加到: MyShare 書籤加到: 美味書籤加到: Furl  書籤加到: YaHoo 分享書籤加到: Google 書籤加到: UDN 書籤加到: Technorati 書籤



加好友 悄悄話 神魂小飛俠
等級:超級版主 文章:336 經驗:1275 威望:0 精華:0 註冊:2006-11-22 13:05:00
[轉帖]銀光+LINQ+WCF 範例(三)  發表心情 Post By:2008-7-4 17:00:00



Creating the Silverlight Application

The next step is to create the Silverlight Application that will interact with this web service. To do so, right-click on the references in the Silverlight project and choose Add Service Reference

Figure 3-10. Adding a  reference to the Web Service

When the Add Service Reference comes up click on Discover and choose Services in Solution.  The service you created will be found. Before clicking OK notice that by clicking on the Service, the operation you created (GetCustoemrByLastName is discovered

Figure 3-11. Choosing the operations you want to Add (Click to view full-size image)

 Clicking OK adds the service to your project.  You will access the Web Service (and its method) through this reference.

Figure 3-12. The reference added to your project

 

Creating the XAML

In the Page.xaml I'll create a very simple UI that will consist of a top row to enter the user's last name and a bottom row to display the results. To start, I'll layout the Grid's rows and columns,

<Grid x:Name="LayoutRoot" Background="White" ShowGridLines="True">

    <Grid.RowDefinitions>

        <RowDefinition Height="10" /> <!--0 Margin-->

        <RowDefinition Height="50" /> <!--1 Prompts-->

        <RowDefinition Height="*" />  <!--2 DataGrid-->

        <RowDefinition Height="10" /> <!--3 Margin-->

    </Grid.RowDefinitions>

    <Grid.ColumnDefinitions>

        <ColumnDefinition Width="10" /> <!--0 Margin-->

        <ColumnDefinition Width="*" />  <!--1 Controls-->

        <ColumnDefinition Width="10" /> <!--2 Margin-->

    </Grid.ColumnDefinitions>

   

</Grid>

Notice that I've set ShowGridLines to true while I'm working to ensure that I'm getting the results I hope for, and that the third row and second column use star sizing; indicating that they should take up all the remaining space.

The Grid has small margins on all sides and two rows, a top small row and a very large bottom row,

Figure 3-13. The grid in design mode

 



神魂大俠徒弟~~神魂小飛俠
生日禮物 支持(0中立(0反對(0回到頂部