2、调用 REST 服务,返回 XML 数据
REST.cs(WCF创建的REST服务)
/// <summary>
/// 提供 REST 服务的类
/// 注:Silverlight只支持 GET 和 POST
/// </summary>
REST.cs(WCF创建的REST服务)
/// <summary>
/// 提供 REST 服务的类
/// 注:Silverlight只支持 GET 和 POST
/// </summary>
Xml.xaml
<UserControl x:Class="Silverlight20.Communication.Xml"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel HorizontalAlignment="Left" Width="600">
<TextBox x:Name="txtMsgXml" Margin="5" />
<TextBox x:Name="txtMsgXml2" Margin="5" />
</StackPanel>
</UserControl>
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel HorizontalAlignment="Left" Width="600">
<TextBox x:Name="txtMsgXml" Margin="5" />
<TextBox x:Name="txtMsgXml2" Margin="5" />
</StackPanel>
</UserControl>
Xml.xaml.cs
RSSAtom.xaml
<UserControl x:Class="Silverlight20.Communication.RSSAtom"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel HorizontalAlignment="Left" >
<TextBox x:Name="txtMsgRSS" Width="600" Margin="5" />
<StackPanel Orientation="Horizontal">
<ListBox x:Name="list" Width="300" Margin="5" SelectionChanged="list_SelectionChanged">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Title.Text}"></TextBlock>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<TextBlock x:Name="detail" Width="300" Margin="5" Text="{Binding Summary.Text}" textwrapping="Wrap" />
</StackPanel>
</StackPanel>
</UserControl>
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel HorizontalAlignment="Left" >
<TextBox x:Name="txtMsgRSS" Width="600" Margin="5" />
<StackPanel Orientation="Horizontal">
<ListBox x:Name="list" Width="300" Margin="5" SelectionChanged="list_SelectionChanged">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Title.Text}"></TextBlock>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<TextBlock x:Name="detail" Width="300" Margin="5" Text="{Binding Summary.Text}" textwrapping="Wrap" />
</StackPanel>
</StackPanel>
</UserControl>
RSSAtom.xaml.cs
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。