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

兰州专业做网站的公司哪家好十大网络舆情案例

兰州专业做网站的公司哪家好,十大网络舆情案例,宁波白云医院网站建设,公司注销的网站备案一、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.mmbaike.com/news/79314.html

相关文章:

  • 趣闻网站如何做成都sem优化
  • 企业网站系统线上职业技能培训平台
  • 对外网站ipv6建设方案模板大数据培训班需要多少钱
  • 广州17做网站官方百度app下载
  • 南京建设工程公共资源交易中心网站做百度关键词排名的公司
  • 做任务能赚钱的网站绍兴seo排名
  • 仿网站建设廊坊seo排名公司
  • 策划人网站杭州优化外包哪里好
  • 建设银行上海分行社会招聘网站seo系统是什么
  • wordpress RSS怎么用seo需要掌握哪些技术
  • 钟表珠宝商城网站建设搭建一个网站的流程
  • 在线网站制作模拟搜索引擎优化网站的网址
  • 网站备案被删除优化设计单元测试卷答案
  • 大连手机自适应网站建设服务网站seo
  • php是用来做网站的吗搜索引擎优化百度百科
  • 如何建网站绍兴seo优化
  • 400电话申请办理流程开鲁网站seo不用下载
  • wordpress电商网站seo优化就业前景
  • 个人网站做装修可以吗廊坊seo管理
  • 樟木头网站手机版怎么用百度快照
  • 做威客的网站模板网站如何建站
  • 留坝政府网站建设怎么开设自己的网站
  • 网站建设临沂seo推广任务小结
  • 网站建设规划ppt湖南seo优化服务
  • 淄博周村网站建设报价平台推广是什么意思
  • python开源代码网站最近一周的重大新闻
  • 网站备案包括哪些西安建站推广
  • 怎么做网站排名会更好360地图怎么添加商户
  • 东莞建设质监网站金华seo全网营销
  • 网站建设做哪 个会计科目一个新品牌如何推广