想问下可做为silverlight数据源的有哪些??WebServices 是否可以。如果可以,那么在silverlight中如何引用Web服务??
还有哪些数据源???

解决方案 »

  1.   

    http://www.cnblogs.com/silverlighter/archive/2007/06/17/786136.html
    支持
      

  2.   

      string symbol = _tickerTextBox.GetAttribute("value");2.                               _stockService = new WebService();3.                               _status.Text = string.Format("Calling {0}\r\n", _stockService.Url);4.                               // Include the proxy object as the asyncState parameter in the call.5.                               IAsyncResult iar = _stockService.BeginGetQuotes(symbol, 6.                                      new AsyncCallback(OnJsonStockDownload), _stockService);if (!iar.IsCompleted) _status.Text += "Waiting for response from server"; 4.3             处理响应:5          public void OnJsonStockDownload(IAsyncResult iar) 6          {7          try 8          {9            // Use the WebService object in AsyncState to obtain the results.10          StockQuote[] quotes = ((WebService)iar.AsyncState).EndGetQuotes(iar);11           for (int i = 0; i < quotes.Length; i++) 12           {13              _result.Text += String.Format("Date {0} Open {1} Closed {2}\r\n",14              quotes[i].Date,15              quotes[i].Open,16              quotes[i].Close);17           }18        }19        20        catch (Exception ex) 21        {22           _status.Text = ex.Message;23        }24        25        finally 26        {27           _requestPending = false;28           _status.Text = "Done";29         }}