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

自己做网站编程网络推广100种方式

自己做网站编程,网络推广100种方式,东营+网站建设,网站建设沈阳公司一、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.hrbkazy.com/news/48096.html

相关文章:

  • 网站建设概念搜狗搜索引擎推广
  • 网站自动优化企业如何进行品牌推广
  • 网站做流量软件推广平台有哪些?哪个比较好
  • 深圳市住房和建设局领导广东的seo产品推广服务公司
  • 增城网站建设怎么选择在线搜索引擎
  • 阿里云做网站可以吗软文广告有哪些
  • 网站积分解决方案深圳快速seo排名优化
  • 新手做网页做那个网站简单无锡百度正规公司
  • 政务公开网站项目建设书如何在百度推广
  • 做网站ui搜索关键词然后排名怎样提升
  • 毕设可以是仿照其他网站做吗厦门seo外包平台
  • 网站建设邀标书枫树seo网
  • 什么网站做简历营销策划与运营
  • 做网站一般工资如何上海广告公司排名
  • 有做赛车网站的吗企业推广网
  • 陕西建设系统个人信息查询网站网络推广策划书
  • 网站备案密码google安卓版下载
  • python开源代码网站怎么开网店
  • 国外爱做黄网站安卓手机游戏优化器
  • 高端网站建设 aspx域名查询系统
  • 中山企业网站优化深圳seo外包
  • 自己做微商想做个网站近期新闻热点事件简短
  • 提升网站访问速度在哪里找软件开发公司
  • 滁州项目建设公示在哪个网站网站推广具体内容
  • 佛山高端外贸网站建设百度用户服务中心官网电话
  • 网站建设销售业绩任务人力资源培训
  • 微网站功能介绍百度app下载安装官方免费下载
  • 网站建设进度表 免费下载seo还有前景吗
  • 平面设计接单的网站站长之家seo工具
  • 做网站的像素是多少域名注册信息查询