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

网站开发的投标案例wordpress图标字体不显示

网站开发的投标案例,wordpress图标字体不显示,东莞做网站优化哪家好,家博会一、DataTemplate 在WPF(Windows Presentation Foundation)中,DataTemplate 用于定义数据的可视化呈现方式。它允许你自定义如何展示数据对象,从而实现更灵活和丰富的用户界面。DataTemplate 通常用于控件(如ListBox、…

一、DataTemplate

在WPF(Windows Presentation Foundation)中,DataTemplate 用于定义数据的可视化呈现方式。它允许你自定义如何展示数据对象,从而实现更灵活和丰富的用户界面。DataTemplate 通常用于控件(如ListBoxComboBoxDataGrid等)的项模板。

1.代码示例

1.1 xaml.cs

using 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.Navigation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;namespace 学习
{public partial class MainWindow : Window{public MainWindow(){InitializeComponent();List<Color> test = new List<Color>();test.Add(new Color() { Code = "Red", Name = "红色" });test.Add(new Color() { Code = "BLUE", Name = "蓝色" });test.Add(new Color() { Code = "YELLOW", Name = "黄色" });test.Add(new Color() { Code = "GREEN", Name = "绿色" });list.ItemsSource = test;}}public class Color{public string Code { get; set; }public string Name { get; set; }}
}

1.2 xaml

<Window x:Class="学习.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"xmlns:local="clr-namespace:学习"mc:Ignorable="d"Title="MainWindow" Height="450" Width="800"><Grid><ListBox x:Name="list"><ListBox.ItemTemplate><DataTemplate><StackPanel Orientation="Horizontal"><Border Width="10" Height="10"Background="{Binding Code}"></Border><TextBlock Margin="10,0" Text="{Binding Name}"></TextBlock></StackPanel></DataTemplate></ListBox.ItemTemplate></ListBox></Grid>
</Window>

2.代码结果

3.代码示例2

后端不变

<Window x:Class="学习.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"xmlns:local="clr-namespace:学习"mc:Ignorable="d"Title="MainWindow" Height="450" Width="800"><Grid><DataGridx:Name="list"AutoGenerateColumns="False"CanUserAddRows="False"><DataGrid.Columns><DataGridTextColumn Binding="{Binding Name}" Header="Name"/><DataGridTextColumn Binding="{Binding Code}" Header="Code"/><DataGridTemplateColumn Header="操作"><!--可操作的--><DataGridTemplateColumn.CellTemplate><DataTemplate><StackPanel Orientation="Horizontal"><Border Width="10"Height="10"Background="{Binding Code}"></Border><TextBlock Margin="10" Text="{Binding Name}"></TextBlock></StackPanel></DataTemplate></DataGridTemplateColumn.CellTemplate></DataGridTemplateColumn></DataGrid.Columns></DataGrid></Grid>
</Window>

4.代码结果

http://www.yayakq.cn/news/49497/

相关文章:

  • 网站建设电销话术开场白网站建设详细流
  • 购物网站代码徐州做网站的公司
  • 网页制作与网站建设实战大全 pdf营养师
  • 网站开发与设计论文网站的做公司
  • 专业网站模仿北京比较有名的设计院
  • 网站搭建项目描述wordpress图片怎么居中
  • 响应适网站开发wordpress 代码 转义
  • 手机网站开发目的汽车网站建设公司
  • 新网站做内链属于网页制作工具
  • 无锡网站改版多少钱网址注册查询
  • 三维免费网站平面设计需要美术功底吗
  • 吕梁推广型网站开发建设网站的服务宗旨
  • 安徽鲁班建设集团网站wordpress页面显示什么
  • 建设网站免费支持php个人做公司网站
  • 传奇网站怎么建设成都网站建设科
  • 网站开发包括哪些技术宠物店网站开发文档撰写
  • 那些钓鱼网站是怎么做的改版
  • 小程序免费制作网站wordpress文章的地址
  • 个人网站作品下载淄博logo设计公司
  • 合肥网站开发外包公司企业官网 开源
  • 一般做企业网站需要什么资料电子商务网站建设复习题
  • 婚恋网站模板下载wordpress .net源码
  • 免费稳定的网站空间茂名网站建设方案推广
  • 公众号里的网站怎么做情侣网站建设策划书
  • 公司建设网站制作俄罗斯最新军事新闻
  • 天津平台网站建设费用南京网站制作公司南京乐识专心
  • 网站后台管理系统有哪些自己做的网站怎么置顶
  • 食材网站模板大全企业网站建设的内容
  • 校园交易网站建设论文广州做网站发多少钱
  • 专业商城网站建设哪家便宜网站设计学什么专业