当前位置: 首页 > news >正文

湖南网站建设制作网站seo思路

湖南网站建设制作,网站seo思路,js 抽奖网站,平面设计培训网站在WPF中&#xff0c;我们可能有些一些数据是静态的&#xff0c;但是是一个迭代的列表显示的内容。MSDN建议使用XmlDataProvider。代码如下<StackPanel x:Name"pn_TaskStatusPanel"Background"#cee8ff"Orientation"Vertical"><StackPane…


在WPF中,我们可能有些一些数据是静态的,但是是一个迭代的列表显示的内容。MSDN建议使用XmlDataProvider。代码如下

 

  <StackPanel x:Name="pn_TaskStatusPanel" Background="#cee8ff" Orientation="Vertical">
        
<StackPanel.Resources>
            
<XmlDataProvider x:Key="dataTaskStatus" XPath="/Tasks">
                
<x:XData>
                    
<Tasks xmlns="">
                        
<Task>
                            
<ImagePath>D:\model1.png</ImagePath>
                            
<Name>XXX</Name>
                            
<Count>20</Count>
                        
</Task>
                        
<Task>
                            
<ImagePath>D:\model1.png</ImagePath>
                            
<Name>XxXX</Name>
                            
<Count>20</Count>
                        
</Task>
                        
<Task>
                            
<ImagePath>D:\model1.png</ImagePath>
                            
<Name>XXX</Name>
                            
<Count>20</Count>
                        
</Task>
                        
<Task>
                            
<ImagePath>D:\model1.png</ImagePath>
                            
<Name>XXXX</Name>
                            
<Count>20</Count>
                        
</Task>
                    
</Tasks>
                
</x:XData>
            
</XmlDataProvider>
        
</StackPanel.Resources>
        
<ListView x:Name="lv_Status" Height="200" Background="#cee8ff" ItemsSource="{Binding Source={StaticResource dataTaskStatus},XPath=Task}" >
            
<ListView.ItemContainerStyle>
                
<Style TargetType="{x:Type ListViewItem}">
                    
<Setter Property="Background" Value="#cee8ff"/>                    
                    
<Style.Triggers>
                        
<Trigger Property="IsMouseOver" Value="True">
                            
<Setter Property="Background" Value="#d6edff" />
                            
                        
</Trigger>
                    
</Style.Triggers>                    
                
</Style>
            
</ListView.ItemContainerStyle>
            
<ListView.ItemTemplate>
                
<DataTemplate>
                    
<Border  Height="50" Width="100" Margin="5" BorderThickness="1" BorderBrush="SteelBlue" CornerRadius="3" HorizontalAlignment="Stretch" >
                        
<Grid Margin="3" ShowGridLines="True" HorizontalAlignment="Stretch" >
                            
<Grid.RowDefinitions>
                                
<RowDefinition Height="25"></RowDefinition>
                                
<RowDefinition Height="25"></RowDefinition>                                
                            
</Grid.RowDefinitions>
                            
<Grid.ColumnDefinitions>
                                
<ColumnDefinition></ColumnDefinition>
                                
<ColumnDefinition ></ColumnDefinition>
                            
</Grid.ColumnDefinitions>
                            
<Image Source="{Binding XPath=ImagePath}" Grid.Column="0" Grid.Row="0" Grid.RowSpan="2" />
                            
<Label Content="{Binding XPath=Name}" Grid.Column="1" Grid.Row="0" Grid.IsSharedSizeScope="True" ></Label>
                            
<Label Content="{Binding XPath=Count}" Grid.Column="1" Grid.Row="1"></Label>
                        
</Grid>
                    
</Border>
                
</DataTemplate>
            
</ListView.ItemTemplate>
        
</ListView>

 

注意。这里面有一个MSDN提示,XmlDataProvider中注意的地方。

 

必须声明: xmlns=""   否则 XPath搜寻路径会失灵。

 

MSDN原文解释。

The root node of the XML data has an xmlns attribute that sets the XML namespace to an empty string. This is a requirement for applying XPath queries to a data island that is inline within the XAML page. In this inline case, the XAML, and thus the data island, inherits the System.Windows namespace. Because of this, you need to set the namespace blank to keep XPath queries from being qualified by the System.Windows namespace, which would misdirect the queries.
  

 

转载于:https://www.cnblogs.com/GeeWu/archive/2011/05/26/wpf_xmlDataProvider.html

http://www.lbrq.cn/news/2696131.html

相关文章:

  • 网站推广软文案例奶盘seo伪原创工具
  • 专业手机网站设计优化英文
  • 自己开网店网络推广优化seo
  • 网站开发后服务费深圳谷歌网络推广公司
  • 公司网站能自己做么友情链接工具
  • 定制建站网站建设google官网入口下载
  • 长葛网站建设线上营销平台
  • 什么网站做海报app推广平台网站
  • 南宁公司做网站阿里云万网域名购买
  • 雄安做网站互联网运营培训课程
  • 那里做网站最好先做后付费的代运营
  • 个人网站免费的吗seo怎么推排名
  • 多种语言网站怎么做自动点击器永久免费版
  • 网站开发后乙方把源代码交给甲方app拉新佣金排行榜
  • 织梦网站seo东莞网站seo优化托管
  • 衡水网站设计怎么做免费推广网站大全集合
  • 中国国际贸易单一窗口网站吉林网络seo
  • 怎么撤销网站备案营销网站制作公司
  • iis如何做网站怎么去推广自己的网站
  • 怎样做视频电影网站seo如何优化关键词排名
  • 怎样建手机网站白帽seo是什么
  • 聊天网站制作教程如何快速推广app
  • 电脑网站建设方案武汉seo优化公司
  • 哪个网站做质量认证书范本聊城seo整站优化报价
  • 公司网站做么做百度排名上海推广外包
  • seo网站建站公司的主页虎扑体育网体育
  • 网站 转成 微信小程序广告软文外链平台
  • 三网合一网站建设方案怎么做网站推广多少钱
  • 西宁做网站的工作室汕头网站建设方案开发
  • 网站建站视频搜索引擎优化概述
  • Java 基础概念笔记
  • Python函数篇:从零到精通
  • 贪心----4.划分字母区间
  • Spark on K8s 在vivo大数据平台的混部实战
  • Mybatis学习之逆向工程(十)
  • 分享一款基于STC32G12K128单片机的螺丝机供料器控制板 ES-IO2422 S4