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

招聘网站开发视频新手如何做网站维护

招聘网站开发视频,新手如何做网站维护,英语不行如何编程做网站,wordpress登录弹窗在 WPF#xff08;Windows Presentation Foundation#xff09;中#xff0c;模板是一种强大的机制#xff0c;用于定义控件的外观。它允许你将控件的逻辑#xff08;功能#xff09;和外观#xff08;UI#xff09;分离开来。例如#xff0c;一个按钮控件#xff0c… 在 WPFWindows Presentation Foundation中模板是一种强大的机制用于定义控件的外观。它允许你将控件的逻辑功能和外观UI分离开来。例如一个按钮控件其默认外观是由微软定义的但通过模板你可以完全改变按钮的外观如改变它的形状、颜色、添加动画效果等。 模板主要有两种类型ControlTemplate用于定义控件的可视结构和 DataTemplate用于定义数据对象的可视化表示。 1. 控件模板ControlTemplate 1.1 在本文件中定义模板 下面XAML文件定义了两个模板分别是Button和label控件的在界面正文时就可以直接调用资源中的控件模板 Window x:ClassTemplate.Views.MainWindowxmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentationxmlns:xhttp://schemas.microsoft.com/winfx/2006/xamlxmlns:prismhttp://prismlibrary.com/prism:ViewModelLocator.AutoWireViewModelTrueTitle{Binding Title} Height350 Width525 Window.Resources!-- 定义按钮控件模板 --ControlTemplate x:KeyMyButtonTemplate TargetTypeButtonBorder BackgroundLightBlue BorderBrushDarkBlue BorderThickness2 CornerRadius5ContentPresenter HorizontalAlignmentCenter VerticalAlignmentCenter//Border/ControlTemplate!--定义Label控件模板--ControlTemplate x:KeyLabelTemplate TargetTypeLabelBorder BackgroundLightBlue BorderBrushDarkBlue BorderThickness2 CornerRadius5ContentPresenter HorizontalAlignmentCenter VerticalAlignmentCenter//Border/ControlTemplate/Window.ResourcesGridStackPanel!-- 使用控件模板 --Button Template{StaticResource MyButtonTemplate} ContentButton 1 Width100 Height50/Button Template{StaticResource MyButtonTemplate} ContentButton 2 Width100 Height50/Label Template{StaticResource LabelTemplate } Content123 Width100 Height40//StackPanel/Grid /Window 1.2 分离资源文添加模板 也可以将资源文件脱离出来单独管理便于在多个界面中使用同一模板 先添加资源文件 编辑资源文件 ResourceDictionary xmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentationxmlns:xhttp://schemas.microsoft.com/winfx/2006/xaml!-- 定义按钮控件模板 --ControlTemplate x:KeyMyButtonTemplate TargetTypeButtonBorder BackgroundLightBlue BorderBrushDarkBlue BorderThickness2 CornerRadius5ContentPresenter HorizontalAlignmentCenter VerticalAlignmentCenter//Border/ControlTemplate!--定义Label控件模板--ControlTemplate x:KeyLabelTemplate TargetTypeLabelBorder BackgroundLightBlue BorderBrushDarkBlue BorderThickness2 CornerRadius5ContentPresenter HorizontalAlignmentCenter VerticalAlignmentCenter//Border/ControlTemplate/ResourceDictionary 呈现效果跟方法一是一样的 2. 数据模板DataTemplate 2.1 定义数据模型 public class Staff {public string Name { get; set; }public int Age { get; set; } } 2.2 在资源文件中定义模板 ResourceDictionary xmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentationxmlns:xhttp://schemas.microsoft.com/winfx/2006/xaml!-- 定义按钮控件模板 --ControlTemplate x:KeyMyButtonTemplate TargetTypeButtonBorder BackgroundLightBlue BorderBrushDarkBlue BorderThickness2 CornerRadius5ContentPresenter HorizontalAlignmentCenter VerticalAlignmentCenter//Border/ControlTemplate!--定义Label控件模板--ControlTemplate x:KeyLabelTemplate TargetTypeLabelBorder BackgroundLightBlue BorderBrushDarkBlue BorderThickness2 CornerRadius5ContentPresenter HorizontalAlignmentCenter VerticalAlignmentCenter//Border/ControlTemplate!--定义数据模板--DataTemplate x:KeyStaffDataTemplateStackPanelTextBlock TextName: FontWeightBold/TextBlock Text{Binding Name} FontWeightBold/TextBlock TextAge: FontWeightBold/TextBlock Text{Binding Age} ForegroundGray//StackPanel/DataTemplate/ResourceDictionary 2.3 初始化数据模型 这里用了Prism框架 public class MainWindowViewModel : BindableBase {private string _title Prism Application;public string Title{get { return _title; }set { SetProperty(ref _title, value); }}private ObservableCollectionStaff _people;public ObservableCollectionStaff People{get { return _people; }set { SetProperty(ref _people, value); }}public MainWindowViewModel(){// 初始化数据People new ObservableCollectionStaff{new Staff { Name Alice, Age 25 },new Staff { Name Bob, Age 30 },new Staff { Name Charlie, Age 35 }};} } 2.4 应用数据模板绑定数据 Window x:ClassTemplate.Views.MainWindowxmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentationxmlns:xhttp://schemas.microsoft.com/winfx/2006/xamlxmlns:prismhttp://prismlibrary.com/prism:ViewModelLocator.AutoWireViewModelTrueTitle{Binding Title} Height350 Width525 Window.Resources!-- 引用外部的资源字典 --ResourceDictionary SourceControlTemplates.xaml//Window.ResourcesGridStackPanel!-- 使用控件模板 --Button Template{StaticResource MyButtonTemplate} ContentButton 1 Width100 Height50/Button Template{StaticResource MyButtonTemplate} ContentButton 2 Width100 Height50/Label Template{StaticResource LabelTemplate } Content123 Width100 Height40/!--这样--ListBox ItemTemplate{StaticResource StaffDataTemplate} ItemsSource{Binding People}/ListBox!--或者这样--StackPanelListBox ItemsSource{Binding People} ItemTemplate{StaticResource StaffDataTemplate}//StackPanel/StackPanel/Grid /Window运行效果 3. 基于模板的样式 StylewithTemplates 3.1 在资源字典中定义一个样式 ResourceDictionary xmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentationxmlns:xhttp://schemas.microsoft.com/winfx/2006/xaml!--定义样式--Style x:KeyMyButtonStyle TargetTypeButtonSetter PropertyBackground ValueLightGreen/Setter PropertyForeground ValueWhite/Setter PropertyFontWeight ValueBold//Style /ResourceDictionary 3.2 使用样式 Window x:ClassTemplate.Views.MainWindowxmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentationxmlns:xhttp://schemas.microsoft.com/winfx/2006/xamlxmlns:prismhttp://prismlibrary.com/prism:ViewModelLocator.AutoWireViewModelTrueTitle{Binding Title} Height350 Width525 Window.Resources!-- 引用外部的资源字典 --ResourceDictionary SourceControlTemplates.xaml //Window.ResourcesGridStackPanel!-- 使用样式 --Button Style{StaticResource MyButtonStyle} ContentButton 1 Width100 Height50/Button Style{StaticResource MyButtonStyle} ContentButton 2 Width100 Height50/Button Style{StaticResource MyButtonStyle} ContentButton 3 Width100 Height50/Button Style{StaticResource MyButtonStyle} ContentButton 4 Width100 Height50//StackPanel/Grid /Window运行效果 4. WPF的模板资源 HandyControl这是一套比较流行的 WPF 控件库几乎重写了所有原生样式并且包含 80 余款自定义控件。在其开源项目中有大量的模板定义和使用案例对于想要快速构建美观的 WPF 应用程序的开发者来说非常有价值。你可以访问HandyControl 的 GitHub 页面获取相关资源。Panuon.WPF.UI该组件库能帮助开发者快速完成样式和控件的 UI 设计提供了大量的属性来方便地修改 WPF 中一些常用的效果而这些效果的实现往往涉及到模板的使用。你可以在Panuon.WPF.UI 的 GitHub 页面上找到相关的代码和示例。ModernUI提供了基于 ModernUI 1.0.4 的 win8 极简化界面设计有丰富的界面组件和样式支持插件化开发便于扩展和维护。你可以从ModernUI 的项目地址获取相关资源。
http://www.w-s-a.com/news/353801/

相关文章:

  • flash 网站欣赏国外做的比较好的网站有哪些
  • 推广一个网站需要什么官网首页设计
  • 淘宝建设网站的理由企业官网建设哪家好
  • 青岛网站推wordpress主题切换
  • 天元建设集团有限公司资质郑州网站seo推广
  • 免费网站后台管理系统模板下载百度网盘app下载安装
  • 开封网站建设培训郑州高端网站建设哪家好
  • 东莞哪家做网站很有名的公司即墨专业医院网站制作公司
  • 做面食网站china cd wordpress
  • 门户网站 营销优秀建筑模型案例作品
  • 训做网站的心得体会范文中山市 有限公司网站建设
  • 服装电子商务网站建设过程与实现两学一做学习教育网站
  • 住房和城建设网站怎么用源码建站
  • 监理工程师证查询网站百度关键词优化软件网站
  • 关于建筑建设的网站asp网站建设报告书
  • 服务二级公司网站建设平台销售模式有哪些
  • 南昌县建设局网站微信分销小程序开发
  • 网站设计师需要什么知识与技能wordpress个性
  • 做茶叶网站的目的和规划有什么做照片书的网站
  • 开福区城乡建设局门户网站关键词挖掘查询工具爱站网
  • 网站建设全国排名沈阳seo按天计费
  • 成都公司网站设计无锡seo网站推广费用
  • 建网站平台要多少钱购物网站界面设计策划
  • 学完js了可以做哪些网站长沙建站官网
  • 怎么样做问卷网站多少钱英语
  • 房产网站建设方案建筑公司是干什么的
  • wordpress建的大型网站柳州市网站建设
  • 石家庄做网站的公司有哪些微信自媒体网站建设
  • 池州哪里有做网站注册公司有哪些风险
  • 做古代风格头像的网站对网站政务建设的建议