文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Asynchronous Web and Network Calls on the Client in WPF(摘录)

Asynchronous Web and Network Calls on the Client in WPF(摘录)

时间:2011-04-17  来源:joe62

1. Solution:WebApp, WpfAff

2. WebApp add :  Silverlight-enabled WCF Service

[OperationContract]
        public IList<Customer> GetCustomers()
        {
            List<Customer> results = new List<Customer>();
            results.Add(new Customer {LastName="Brown",FisrtName="Pete" });
            results.Add(new Customer { LastName = "Stagner", FisrtName = "Joe" });
            results.Add(new Customer { LastName = "Liberty", FisrtName = "Jesse" });
            results.Add(new Customer { LastName = "Galloway", FisrtName = "Jon`" });
            return results;
        }

3. WpfApp:

       private void CallService_Click(object sender, RoutedEventArgs e)
        {
            var client = new Service.CustomerServiceClient();
            client.GetCustomersCompleted += (s, ev) =>
            {
                CustomerList.ItemsSource = ev.Result;
            };
            client.GetCustomersAsync();
        }

---------------------------------------------------

                   <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding LastName}" />
                        <TextBlock Text=", " />
                        <TextBlock  Text="{Binding FisrtName}"/>
                    </StackPanel>
                </DataTemplate>

Solution:

 

相关阅读 更多 +
排行榜 更多 +
找茬脑洞的世界安卓版

找茬脑洞的世界安卓版

休闲益智 下载
滑板英雄跑酷2手游

滑板英雄跑酷2手游

休闲益智 下载
披萨对对看下载

披萨对对看下载

休闲益智 下载