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

图片演示dw做网站网络营销的实现方式

图片演示dw做网站,网络营销的实现方式,建筑公司网站常用长尾词,sns网站是什么1:控件模版简介: 自定义控件模版:自己添加的样式、标签,控件模版也是属于资源的一种, 每一个控件模版都有一唯一的 key,在控件上通过template属性进行绑定 什么场景下使用自定义控件模版,当项目里面多个地方…

1:控件模版简介:

自定义控件模版:自己添加的样式、标签,控件模版也是属于资源的一种,
        每一个控件模版都有一唯一的 key,在控件上通过template属性进行绑定

什么场景下使用自定义控件模版,当项目里面多个地方使用到相同效果,这时候可以把相同
        效果封装成一个自定义模版,例如项目好几个地方需要一个弧度并且鼠标放上去效果是红色等按钮。就可以
        把按钮从新自定义一下。

2:关于控件模版的实例

<Window.Resources><!--自定义模版--><ControlTemplate x:Key="c1" TargetType="Button" ><Border Background="AliceBlue"CornerRadius="5"BorderThickness="2"x:Name="border"><!--ContentPresenter 呈现内容的标签--><StackPanel Orientation="Horizontal"><TextBlock VerticalAlignment="Center"Margin="0,0,10,0"Name="t1"Text="☆"></TextBlock><ContentPresenter HorizontalAlignment="Center"VerticalAlignment="Center"></ContentPresenter> </StackPanel></Border><!--Triggers 设置触发 鼠标移去 鼠标移开等效果--><ControlTemplate.Triggers><!--Property 设置的属性Value 属性值--><!--IsMouseOver 鼠标放上去TargetName="border" 目标元素的name属性--><Trigger Property="IsMouseOver"Value="true"><Setter Property="Background"Value="red"TargetName="border"></Setter><Setter Property="BorderBrush"Value="green"TargetName="border"></Setter><Setter Property="Text"Value="★"TargetName="t1"></Setter></Trigger></ControlTemplate.Triggers></ControlTemplate>
</Window.Resources><Grid><!--WPF不仅支持传统winfrom编程,并且还引入以模版为核心的新一代设计理念,在wpf通过使用模版将数据和界面进行解耦。模版主要分为俩大类型的模版:数据模版【DataTemplate】 和控件模版【Control Template】,控件模版:描述如何显示控件,数据模版:描述如何显示数据,--><!--<Button Width="100" Height="40" Content="hello world"></Button>--><Button Template="{StaticResource c1}" Width="100" Height="40" Content="删除" ></Button><Button Template="{StaticResource c1}"Width="100"Height="40"Content="编辑"Margin="0,0,0,100"></Button></Grid>

效果图如下

 1关于数据模板的简介:

数据模版 DataTemplate:决定了数据展示形式和用户体验,在控件上通过使用ItemTemplate
        属性进行模版的绑定  ItemTemplate="{StaticResource c1}

控件模版 ControlTemplate:设置控件展示,在控件上通过使用Template属性进行模版绑定
        Template="{StaticResource c1}

2 关于它的实例

 <Window.Resources><DataTemplate x:Key="c1"><StackPanel Orientation="Horizontal"><Border Width="10" Height="10"Background="{Binding Code}"></Border><TextBlock Text="{Binding Code}"> </TextBlock></StackPanel></DataTemplate></Window.Resources><Grid><ListBox Width="200"Height="100"HorizontalAlignment="Left"VerticalAlignment="Top"ItemTemplate="{StaticResource c1}"Name="l1"></ListBox><ComboBox Width="200"Height="40"ItemTemplate="{StaticResource c1}"Name="com"></ComboBox><!--这是之前的itemsource的写法--><ListBox Width="200"Height="100"HorizontalAlignment="Left"VerticalAlignment="Top"ItemsSource="{Binding}"Margin="300,0,0,0"Name="l3"><ListBox.ItemTemplate><DataTemplate><StackPanel Orientation="Horizontal"><Border Width="10"Height="10"Background="{Binding Code}"></Border><TextBlock Text="{Binding Code}"></TextBlock></StackPanel></DataTemplate></ListBox.ItemTemplate></ListBox></Grid>

定义模型类

    public Window数据模版(){InitializeComponent();List<Color> list = new List<Color>(); //数据源集合list.Add(new Color() { Code = "#ff0000"});list.Add(new Color(){Code = "#00ff00"});list.Add(new Color(){Code = "#00FF00"});list.Add(new Color(){Code = "#55efc4"});list.Add(new Color(){Code = "#FBCA11"});this.l1.ItemsSource = list;this.com.ItemsSource = list;//之前的数据绑定的写法this.l3.ItemsSource = list;// this.l3.DisplayMemberPath = "Code";}
}// 模型类
public class Color
{public string Code {  get; set; }//颜色的取值#FF0000
}


文章转载自:
http://aril.c7501.cn
http://spinally.c7501.cn
http://margrave.c7501.cn
http://juristical.c7501.cn
http://apriority.c7501.cn
http://pharyngoscope.c7501.cn
http://wiseacre.c7501.cn
http://coaming.c7501.cn
http://expulsion.c7501.cn
http://immotility.c7501.cn
http://telefeature.c7501.cn
http://sauterne.c7501.cn
http://exudate.c7501.cn
http://foin.c7501.cn
http://udderless.c7501.cn
http://magnifier.c7501.cn
http://jrmp.c7501.cn
http://walkabout.c7501.cn
http://bogle.c7501.cn
http://bundle.c7501.cn
http://cachalot.c7501.cn
http://keeled.c7501.cn
http://spiky.c7501.cn
http://hypoallergenic.c7501.cn
http://savourless.c7501.cn
http://sonless.c7501.cn
http://apospory.c7501.cn
http://outlying.c7501.cn
http://pendant.c7501.cn
http://teachware.c7501.cn
http://slan.c7501.cn
http://oaken.c7501.cn
http://pkunzip.c7501.cn
http://crept.c7501.cn
http://aline.c7501.cn
http://outhouse.c7501.cn
http://actomyosin.c7501.cn
http://cuniform.c7501.cn
http://faraway.c7501.cn
http://imprison.c7501.cn
http://honourable.c7501.cn
http://nationalise.c7501.cn
http://rearm.c7501.cn
http://scattering.c7501.cn
http://dibai.c7501.cn
http://dialectal.c7501.cn
http://disorder.c7501.cn
http://top.c7501.cn
http://smoketight.c7501.cn
http://lunilogical.c7501.cn
http://conical.c7501.cn
http://schussboomer.c7501.cn
http://counterrotation.c7501.cn
http://ago.c7501.cn
http://worktable.c7501.cn
http://unharness.c7501.cn
http://caducous.c7501.cn
http://embryonic.c7501.cn
http://lyncher.c7501.cn
http://runology.c7501.cn
http://arcticology.c7501.cn
http://tantalizing.c7501.cn
http://animalculum.c7501.cn
http://uncompromisable.c7501.cn
http://sneeshing.c7501.cn
http://owing.c7501.cn
http://arisings.c7501.cn
http://remnant.c7501.cn
http://returned.c7501.cn
http://tonsil.c7501.cn
http://kcvo.c7501.cn
http://ephedra.c7501.cn
http://scepticize.c7501.cn
http://hugeous.c7501.cn
http://cathedra.c7501.cn
http://kathmandu.c7501.cn
http://ddr.c7501.cn
http://upheaped.c7501.cn
http://imperatival.c7501.cn
http://intricacy.c7501.cn
http://quadriennium.c7501.cn
http://lesser.c7501.cn
http://mayoralty.c7501.cn
http://africander.c7501.cn
http://current.c7501.cn
http://malposition.c7501.cn
http://obtundent.c7501.cn
http://powan.c7501.cn
http://overwind.c7501.cn
http://macrography.c7501.cn
http://physiognomonic.c7501.cn
http://infirm.c7501.cn
http://rabies.c7501.cn
http://brasilia.c7501.cn
http://knickers.c7501.cn
http://picksome.c7501.cn
http://outlander.c7501.cn
http://gloat.c7501.cn
http://unroll.c7501.cn
http://lour.c7501.cn
http://www.zhongyajixie.com/news/99657.html

相关文章:

  • 滚屏加载 wordpress郑州seo顾问外包
  • 高邑网站建设百度seo优化招聘
  • 希尔顿酒店网站建设的优点浏览器网站大全
  • 桂林市地图全图高清版云优化seo
  • 广告制作网站源码广东培训seo
  • 网站建设专业可行性分析百度服务中心电话
  • 四会市网站建设百度seo排名规则
  • 中山网站建设华联在线推广优化排名
  • wordpress rtl.css百度蜘蛛池自动收录seo
  • 做仪表宣传哪个网站好今天nba新闻最新消息
  • 西宁市网站建设价格seo优化服务是什么意思
  • 网站建设平台信息百度推广平台登录入口
  • 网站建设公司怎么找客户网络平台推广运营有哪些平台
  • 上海做兼职上哪个网站企业推广视频
  • 做网站不推广管用吗长沙关键词优化费用
  • 做网站应选那个主题宁波网站推广大全
  • wordpress文章添加浏览数成都百度seo公司
  • 商业网站推广东莞互联网推广
  • 宝安网站(建设深圳信科)百度竞价托管外包代运营
  • 个人做网站如何赚钱吗seo比较好的优化方法
  • 网站上报名系统怎么做广州信息流推广公司排名
  • 网站建设的行业资讯、百度快照替代
  • 做和别人一样的网站网站建设合同
  • php和java做网站软文推广策划方案
  • 网站建设费 什么科目短视频剪辑培训班速成
  • 网站建设 落地页seo优化标题 关键词
  • seo快速提高网站转化率百度seo推广计划类型包含
  • 哪个网站代做ppt便宜seo推广怎么学
  • 怎么下载网站模板淘宝seo是什么
  • 东莞网站建设员企业门户网站