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

网站制作 牛商网wordpress商城 微信支付

网站制作 牛商网,wordpress商城 微信支付,网站建设前言,wordpress悬浮小宠物《深入浅出WPF》读书笔记.11Template机制(上) 背景 模板机制用于实现控件数据算法的内容与外观的解耦。 《深入浅出WPF》读书笔记.11Template机制(上) 模板机制 模板分类 数据外衣DataTemplate 常用场景 事件驱动和数据驱动的区别 示例代码 使用DataTemplate实现数据样式…《深入浅出WPF》读书笔记.11Template机制(上) 背景 模板机制用于实现控件数据算法的内容与外观的解耦。 《深入浅出WPF》读书笔记.11Template机制(上) 模板机制 模板分类 数据外衣DataTemplate 常用场景 事件驱动和数据驱动的区别 示例代码 使用DataTemplate实现数据样式 Window x:ClassTemplateDemo.DataTemplateViewxmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentationxmlns:xhttp://schemas.microsoft.com/winfx/2006/xamlxmlns:dhttp://schemas.microsoft.com/expression/blend/2008xmlns:mchttp://schemas.openxmlformats.org/markup-compatibility/2006xmlns:localclr-namespace:TemplateDemomc:IgnorabledTitleDataTemplateView Height450 Width800Window.Resourceslocal:AutoMaker2PhotoPathConverter x:Keya2p/local:AutoMaker2PhotoPathConverterlocal:Name2PhotoPathConverter x:Keyn2p/local:Name2PhotoPathConverterDataTemplate x:KeydetailTemplateBorder BorderBrushBlack BorderThickness1 CornerRadius6StackPanel Margin5Image x:Nameimg1 Height250 Width400 Source{Binding Name,Converter{StaticResource n2p}}/ImageStackPanel OrientationHorizontalTextBlock TextName: FontSize25 FontWeightBold/TextBlockTextBlock x:NametblName FontSize25 FontWeightBold Text{Binding Name}/TextBlock/StackPanelStackPanel OrientationHorizontalTextBlock TextAutoMaker: Margin5/TextBlockTextBlock x:NametblAutoMaker Margin5 Text{Binding AutoMaker}/TextBlockTextBlock TextYear: Margin5/TextBlockTextBlock x:NametblYear Margin5 Text{Binding Year}/TextBlockTextBlock TextTopSpeed:: Margin5/TextBlockTextBlock x:NametblTopSpeed Margin5 Text{Binding TopSpeed}/TextBlock/StackPanel/StackPanel/Border/DataTemplateDataTemplate x:KeycarListItemBorder BorderBrushBlack CornerRadius6 BorderThickness1StackPanel Margin5 OrientationHorizontalImage Source{Binding Name,Converter{StaticResource n2p}} Width64 Height64/ImageStackPanelTextBlock Text{Binding Name}/TextBlockTextBlock Text{Binding Year}/TextBlock/StackPanel/StackPanel/Border/DataTemplate/Window.ResourcesGridGrid.ColumnDefinitionsColumnDefinition Width200*/ColumnDefinitionColumnDefinition Width100*/ColumnDefinition/Grid.ColumnDefinitionsUserControl x:NameucCarDetail Grid.Column0 ContentTemplate{StaticResource detailTemplate} Content{Binding ElementNamelistBoxCar,PathSelectedItem}/UserControlListBox x:NamelistBoxCar Grid.Column1 ItemTemplate{StaticResource carListItem}/ListBox/Grid /Windowusing System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes;namespace TemplateDemo {/// summary/// DataTemplateView.xaml 的交互逻辑/// /summarypublic partial class DataTemplateView : Window{public DataTemplateView(){InitializeComponent();GetCarData();}public void GetCarData(){ListCar cars new ListCar(){new Car{Nameavatar1,Year1998,AutomakerCN,TopSpeed300},new Car{Nameavatar2,Year1999,AutomakerCN,TopSpeed350},new Car{Nameavatar3,Year2000,AutomakerCN,TopSpeed400}};this.listBoxCar.ItemsSource cars;}} }using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Data;namespace TemplateDemo {public class L2BConver : IValueConverter{public object Convert(object value, Type targetType, object parameter, CultureInfo culture){return (int)value 6 ? true : false;}public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture){throw new NotImplementedException();}} }代码说明 控件外衣ContentTemplate 用途 使用blend观看控件内部 Window x:ClassTemplateDemo.ControlTemplatexmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentationxmlns:xhttp://schemas.microsoft.com/winfx/2006/xamlxmlns:dhttp://schemas.microsoft.com/expression/blend/2008xmlns:mchttp://schemas.openxmlformats.org/markup-compatibility/2006xmlns:localclr-namespace:TemplateDemomc:IgnorabledTitleControlTemplate Height300 Width400Window.ResourcesStyle x:KeyRoundCornerTextBox BasedOn{x:Null} TargetTypeTextBoxSetter PropertyTemplateSetter.ValueControlTemplate TargetTypeTextBoxBorder CornerRadius5 x:Namebd SnapsToDevicePixelsTrueBorderBrush{TemplateBinding BorderBrush} BorderThickness{TemplateBinding BorderThickness} Background{TemplateBinding Background}ScrollViewer x:NamePART_ContentHost SnapsToDevicePixels{TemplateBinding SnapsToDevicePixels}/ScrollViewer/Border/ControlTemplate/Setter.Value/Setter/Style/Window.ResourcesWindow.BackgroundLinearGradientBrush StartPoint0.5,0 EndPoint0.5,1GradientStop ColorOrange Offset0/GradientStopGradientStop ColorWhite Offset1/GradientStop/LinearGradientBrush/Window.BackgroundStackPanelTextBox Width120 Height40 Style{StaticResource RoundCornerTextBox} BorderBrushBlack Margin5/TextBoxTextBox Width120 Height40 Style{StaticResource RoundCornerTextBox} BorderBrushBlack Margin5/TextBoxButton Width120 Height40 Content点击一下 Margin5/Button/StackPanel /WindowWindow x:ClassTemplateDemo.PanelTemplatexmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentationxmlns:xhttp://schemas.microsoft.com/winfx/2006/xamlxmlns:dhttp://schemas.microsoft.com/expression/blend/2008xmlns:mchttp://schemas.openxmlformats.org/markup-compatibility/2006xmlns:localclr-namespace:TemplateDemomc:IgnorabledTitlePanelTemplate Height450 Width800GridListBoxListBox.ItemsPanelItemsPanelTemplateStackPanel OrientationVertical/StackPanel /ItemsPanelTemplate/ListBox.ItemsPanelTextBlock Text郭靖/TextBlockTextBlock Text黄蓉/TextBlockTextBlock Text杨康/TextBlockTextBlock Text穆念慈/TextBlock/ListBox/Grid /WindowGit地址 GitHub - wanghuayu-hub2021/WpfBookDemo: 深入浅出WPF的demo
http://www.w-s-a.com/news/39851/

相关文章:

  • 平面设计培训网站建文帝网站建设
  • python网站建设佛山乐从网站建设
  • 网站 免费 托管运营app软件大全
  • 爱网站找不到了网站设计制作要交印花税
  • 分销平台是什么意思网站如何从行为数据进行优化
  • 做网站公司职务做民俗酒店到哪些网站推荐
  • 从0到建网站wordpress导航主题模板下载地址
  • 以3d全景做的网站统计网站的代码
  • 北辰网站建设WordPress换主题文件夹
  • 做网站的合同范文百度分析工具
  • 深圳企业网站制作公司单位注册wordpress发送邮件
  • 兰州专业网站建设团队wordpress 拉取点击数
  • 基于php房产网站开发ppt模板免费下载第一ppt
  • 网站盈利模式分析怎么做山东营销网站建设联系方式
  • 二级网站建设 知乎我的个人主页模板
  • wordpress小说网站模板下载地址百度优化服务
  • 云南网页设计制作seo计费系统源码
  • 屏蔽ip网站吗行业外贸网站建设
  • 河北城乡建设学校网站常州网站建设公司平台
  • 合肥网站建设市场分析网站收录后怎么做排名
  • 湖南企业网站建设如何推广手机网站
  • 网站建设项目经历网站推广服务 商务服务
  • 加强网站的建设福州seo排名外包
  • 做婚庆找什么网站有专门为个人网站做推广的吗
  • 网站搭建要求模板学编程需要英语基础吗
  • 网上如何建网站卖量具净水机企业网站源码
  • 网站推广 软件规划设计公司年终总结
  • 视频网站开发方法微站网建站系统
  • 渐变网站网页界面设计的宗旨是什么
  • 网站排名提升工具免费韶关做网站公司