示例:WPF开发的简单ObjectProperyForm用来绑定实体表单
原文:示例:WPF开发的简单ObjectProperyForm用来绑定实体表单
一、目的:自定义控件,用来直接绑定实体数据,简化开发周期
二、实现:
1、绑定实体对象
2、通过特性显示属性名称
3、通过特性增加验证条件
4、已经实现String、Int、Double、DateTime、Bool几种简单类型的DataTemplate模板,其他模板支持扩展
5、其他后续更新...
三、示例:

实体定义如下:
-
public class Student
-
{
-
[Display("姓名")]
-
[Required]
-
public string Name { get; set; }
-
-
[Display("班级")]
-
[Required]
-
public string Class { get; set; }
-
-
[Display("地址")]
-
[Required]
-
public string Address { get; set; }
-
-
[Display("邮箱")]
-
[Required]
-
public string Emall { get; set; }
-
-
[Display("可用")]
-
[Required]
-
public bool IsEnbled { get; set; }
-
-
[Display("时间")]
-
[Required]
-
public DateTime time { get; set; }
-
-
[Display("年龄")]
-
[Required]
-
public int Age { get; set; }
-
-
[Display("平均分")]
-
public double Score { get; set; }
-
-
[Display("电话号码")]
-
[Required]
-
[RegularExpression(@"^1[3|4|5|7|8][0-9]{9}$", ErrorMessage = "手机号码不合法!")]
-
public string Tel { get; set; }
-
}
DisplayAttribute:用来标识显示名称
ResuiredAttribute:用来标识数据不能为空
RgularExpression:引用正则表达式验证数据是否匹配
其他特性后续更新...
应用方式:
-
-
<UserControl.Resources>
-
<local:Student x:Key="S.Student.HeBianGu"
-
Name="河边骨"
-
Address="四川省成都市高新区"
-
Class="四年级"
-
Emall="7777777777@QQ.com" Age="33" Score="99.99" IsEnbled="True" time="2019-09-09"/>
-
</UserControl.Resources>
-
-
<wpfcontrollib:ObjectPropertyForm Grid.Row="1" Title="学生信息" SelectObject="{StaticResource S.Student.HeBianGu}" >
-
<base:Interaction.Behaviors>
-
<base:MouseDragElementBehavior ConstrainToParentBounds="True"/>
-
<base:SelectZIndexElementBehavior/>
-
</base:Interaction.Behaviors>
四、代码
1、通过反射获取属性和特性
-
ObservableCollection<ObjectPropertyItem> PropertyItemSource
-
{
-
get { return (ObservableCollection<ObjectPropertyItem>)GetValue(PropertyItemSourceProperty); }
-
set { SetValue(PropertyItemSourceProperty, value); }
-
}
-
-
// Using a DependencyProperty as the backing store for MyProperty. This enables animation, styling, binding, etc...
-
public static readonly DependencyProperty PropertyItemSourceProperty =
-
DependencyProperty.Register("PropertyItemSource", typeof(ObservableCollection<ObjectPropertyItem>), typeof(ObjectPropertyForm), new PropertyMetadata(new ObservableCollection<ObjectPropertyItem>(), (d, e) =>
-
{
-
ObjectPropertyForm control = d as ObjectPropertyForm;
-
-
if (control == null) return;
-
-
ObservableCollection<ObjectPropertyItem> config = e.NewValue as ObservableCollection<ObjectPropertyItem>;
-
-
}));
-
-
-
void RefreshObject(object o)
-
{
-
Type type = o.GetType();
-
-
var propertys = type.GetProperties();
-
-
this.PropertyItemSource.Clear();
-
-
foreach (var item in propertys)
-
{
-
var from = ObjectPropertyFactory.Create(item, o);
-
-
this.PropertyItemSource.Add(from);
-
}
-
-
this.ItemsSource = this.PropertyItemSource;
-
}
2、定义类型基类、扩展之类和工厂方法
-
/// <summary> 类型基类 </summary>
-
public class ObjectPropertyItem : NotifyPropertyChanged
-
{
-
public string Name { get; set; }
-
public PropertyInfo PropertyInfo { get; set; }
-
-
public object Obj { get; set; }
-
public ObjectPropertyItem(PropertyInfo property, object obj)
-
{
-
PropertyInfo = property;
-
-
-
var display = property.GetCustomAttribute<DisplayAttribute>();
-
-
Name = display == null ? property.Name : display.Name;
-
-
Obj = obj;
-
}
-
-
-
}
-
-
/// <summary> 泛型类型基类 </summary>
-
public class ObjectPropertyItem<T> : ObjectPropertyItem
-
{
-
private T _value;
-
/// <summary> 说明 </summary>
-
public T Value
-
{
-
get { return _value; }
-
set
-
{
-
-
this.Message = null;
-
-
// Do:检验数据有效性
-
if (Validations != null)
-
{
-
foreach (var item in Validations)
-
{
-
if (!item.IsValid(value))
-
{
-
this.Message = item.ErrorMessage;
-
}
-
}
-
}
-
-
_value = value;
-
-
RaisePropertyChanged("Value");
-
-
this.SetValue(value);
-
}
-
}
-
-
void SetValue(T value)
-
{
-
this.PropertyInfo.SetValue(Obj, value);
-
}
-
-
List<ValidationAttribute> Validations { get; }
-
-
public ObjectPropertyItem(PropertyInfo property, object obj) : base(property, obj)
-
{
-
Value = (T)property.GetValue(obj);
-
-
Validations = property.GetCustomAttributes<ValidationAttribute>()?.ToList();
-
-
if(Validations!=null&& Validations.Count>0)
-
{
-
this.Flag = "*";
-
}
-
}
-
-
-
-
private string _message;
-
/// <summary> 说明 </summary>
-
public string Message
-
{
-
get { return _message; }
-
set
-
{
-
_message = value;
-
RaisePropertyChanged("Message");
-
}
-
}
-
-
public string Flag { get; set; }
-
-
}
-
-
/// <summary> 字符串属性类型 </summary>
-
public class StringPropertyItem : ObjectPropertyItem<string>
-
{
-
public StringPropertyItem(PropertyInfo property, object obj) : base(property, obj)
-
{
-
}
-
}
-
-
/// <summary> 时间属性类型 </summary>
-
public class DateTimePropertyItem : ObjectPropertyItem<DateTime>
-
{
-
public DateTimePropertyItem(PropertyInfo property, object obj) : base(property, obj)
-
{
-
}
-
}
-
-
/// <summary> Double属性类型 </summary>
-
public class DoublePropertyItem : ObjectPropertyItem<double>
-
{
-
public DoublePropertyItem(PropertyInfo property, object obj) : base(property, obj)
-
{
-
}
-
}
-
-
/// <summary> Int属性类型 </summary>
-
-
public class IntPropertyItem : ObjectPropertyItem<int>
-
{
-
public IntPropertyItem(PropertyInfo property, object obj) : base(property, obj)
-
{
-
}
-
}
-
-
/// <summary> Bool属性类型 </summary>
-
public class BoolPropertyItem : ObjectPropertyItem<bool>
-
{
-
public BoolPropertyItem(PropertyInfo property, object obj) : base(property, obj)
-
{
-
}
-
}
类型工厂:
-
public class ObjectPropertyFactory
-
{
-
public static ObjectPropertyItem Create(PropertyInfo info, object obj)
-
{
-
if (info.PropertyType == typeof(int))
-
{
-
return new IntPropertyItem(info, obj);
-
}
-
else if (info.PropertyType == typeof(string))
-
{
-
return new StringPropertyItem(info, obj);
-
}
-
else if (info.PropertyType == typeof(DateTime))
-
{
-
return new DateTimePropertyItem(info, obj);
-
}
-
else if (info.PropertyType == typeof(double))
-
{
-
return new DoublePropertyItem(info, obj);
-
}
-
else if (info.PropertyType == typeof(bool))
-
{
-
return new BoolPropertyItem(info, obj);
-
}
-
-
return null;
-
}
-
}
3、样式模板
-
<DataTemplate DataType="{x:Type base:StringPropertyItem}">
-
<Grid Width="{Binding RelativeSource={RelativeSource AncestorType=local:ObjectPropertyForm},Path=Width-5}"
-
Height="35" Margin="5,0">
-
<Grid.ColumnDefinitions>
-
<ColumnDefinition Width="*"/>
-
<ColumnDefinition Width="Auto"/>
-
<ColumnDefinition Width="2*"/>
-
<ColumnDefinition Width="30"/>
-
</Grid.ColumnDefinitions>
-
-
<TextBlock Text="{Binding Name}"
-
FontSize="14"
-
HorizontalAlignment="Center"
-
VerticalAlignment="Center"/>
-
-
<TextBlock Text="{Binding Flag}"
-
Grid.Column="1" Margin="5,0"
-
FontSize="14" Foreground="{DynamicResource S.Brush.Red.Notice}"
-
HorizontalAlignment="Right"
-
VerticalAlignment="Center"/>
-
-
<local:FTextBox Text="{Binding Value,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource DefaultTextBox}"
-
FontSize="14" Width="Auto" CaretBrush="Black"
-
Grid.Column="2" Height="30" base:ControlAttachProperty.FIcon=""
-
VerticalContentAlignment="Center"
-
HorizontalAlignment="Stretch" VerticalAlignment="Center"/>
-
-
<TextBlock Text="" Grid.Column="3" Style="{DynamicResource FIcon }"
-
Foreground="{DynamicResource S.Brush.Red.Notice}"
-
Visibility="{Binding Message,Converter={x:Static base:XConverter.VisibilityWithOutStringConverter},ConverterParameter={x:Null},Mode=TwoWay}"
-
FontSize="14" TextTrimming="CharacterEllipsis" ToolTip="{Binding Message}"
-
HorizontalAlignment="Center"
-
VerticalAlignment="Center"/>
-
</Grid>
-
</DataTemplate>
-
-
<DataTemplate DataType="{x:Type base:BoolPropertyItem}">
-
<Grid Width="{Binding RelativeSource={RelativeSource AncestorType=local:ObjectPropertyForm},Path=Width-5}" Height="35" Margin="5,0">
-
<Grid.ColumnDefinitions>
-
<ColumnDefinition Width="*"/>
-
<ColumnDefinition Width="Auto"/>
-
<ColumnDefinition Width="2*"/>
-
<ColumnDefinition Width="30"/>
-
</Grid.ColumnDefinitions>
-
-
<TextBlock Text="{Binding Name}"
-
FontSize="14"
-
HorizontalAlignment="Center"
-
VerticalAlignment="Center"/>
-
-
<TextBlock Text="{Binding Flag}"
-
Grid.Column="1" Margin="5,0"
-
FontSize="14" Foreground="{DynamicResource S.Brush.Red.Notice}"
-
HorizontalAlignment="Right"
-
VerticalAlignment="Center"/>
-
<CheckBox IsChecked="{Binding Value}" FontSize="14" Grid.Column="2" Height="30"
-
VerticalContentAlignment="Center"
-
HorizontalAlignment="Left" VerticalAlignment="Center"/>
-
-
-
<TextBlock Text="" Grid.Column="3" Style="{DynamicResource FIcon }"
-
Foreground="{DynamicResource S.Brush.Red.Notice}" Visibility="{Binding Message,Converter={x:Static base:XConverter.VisibilityWithOutStringConverter},ConverterParameter={x:Null}}"
-
FontSize="14" TextTrimming="CharacterEllipsis" ToolTip="{Binding Message}"
-
HorizontalAlignment="Center"
-
VerticalAlignment="Center"/>
-
</Grid>
-
</DataTemplate>
-
-
<DataTemplate DataType="{x:Type base:DateTimePropertyItem}">
-
<Grid Width="{Binding RelativeSource={RelativeSource AncestorType=local:ObjectPropertyForm},Path=Width-5}" Height="35" Margin="5,0">
-
<Grid.ColumnDefinitions>
-
<ColumnDefinition Width="*"/>
-
<ColumnDefinition Width="Auto"/>
-
<ColumnDefinition Width="2*"/>
-
<ColumnDefinition Width="30"/>
-
</Grid.ColumnDefinitions>
-
-
<TextBlock Text="{Binding Name}"
-
FontSize="14"
-
HorizontalAlignment="Center"
-
VerticalAlignment="Center"/>
-
-
<TextBlock Text="{Binding Flag}"
-
Grid.Column="1" Margin="5,0"
-
FontSize="14" Foreground="{DynamicResource S.Brush.Red.Notice}"
-
HorizontalAlignment="Right"
-
VerticalAlignment="Center"/>
-
<DatePicker SelectedDate="{Binding Value}" FontSize="14" Grid.Column="2" Height="30"
-
VerticalContentAlignment="Center" Width="Auto"
-
HorizontalAlignment="Stretch" VerticalAlignment="Center"/>
-
-
-
<TextBlock Text="" Grid.Column="3" Style="{DynamicResource FIcon }"
-
Foreground="{DynamicResource S.Brush.Red.Notice}" Visibility="{Binding Message,Converter={x:Static base:XConverter.VisibilityWithOutStringConverter},ConverterParameter={x:Null}}"
-
FontSize="14" TextTrimming="CharacterEllipsis" ToolTip="{Binding Message}"
-
HorizontalAlignment="Center"
-
VerticalAlignment="Center"/>
-
</Grid>
-
</DataTemplate>
-
-
<DataTemplate DataType="{x:Type base:IntPropertyItem}">
-
<Grid Width="{Binding RelativeSource={RelativeSource AncestorType=local:ObjectPropertyForm},Path=Width-5}" Height="35" Margin="5,0">
-
<Grid.ColumnDefinitions>
-
<ColumnDefinition Width="*"/>
-
<ColumnDefinition Width="Auto"/>
-
<ColumnDefinition Width="2*"/>
-
<ColumnDefinition Width="30"/>
-
</Grid.ColumnDefinitions>
-
-
<TextBlock Text="{Binding Name}"
-
FontSize="14"
-
HorizontalAlignment="Center"
-
VerticalAlignment="Center"/>
-
-
<TextBlock Text="{Binding Flag}"
-
Grid.Column="1" Margin="5,0"
-
FontSize="14" Foreground="{DynamicResource S.Brush.Red.Notice}"
-
HorizontalAlignment="Right"
-
VerticalAlignment="Center"/>
-
<Slider Value="{Binding Value}" FontSize="14" Grid.Column="2" Height="30"
-
VerticalContentAlignment="Center"
-
HorizontalAlignment="Stretch" VerticalAlignment="Center"/>
-
-
-
<TextBlock Text="" Grid.Column="3" Style="{DynamicResource FIcon }"
-
Foreground="{DynamicResource S.Brush.Red.Notice}" Visibility="{Binding Message,Converter={x:Static base:XConverter.VisibilityWithOutStringConverter},ConverterParameter={x:Null}}"
-
FontSize="14" TextTrimming="CharacterEllipsis" ToolTip="{Binding Message}"
-
HorizontalAlignment="Center"
-
VerticalAlignment="Center"/>
-
</Grid>
-
</DataTemplate>
-
-
<DataTemplate DataType="{x:Type base:DoublePropertyItem}">
-
<Grid Width="{Binding RelativeSource={RelativeSource AncestorType=local:ObjectPropertyForm},Path=Width-5}" Height="35" Margin="5,0">
-
<Grid.ColumnDefinitions>
-
<ColumnDefinition Width="*"/>
-
<ColumnDefinition Width="Auto"/>
-
<ColumnDefinition Width="2*"/>
-
<ColumnDefinition Width="30"/>
-
</Grid.ColumnDefinitions>
-
-
<TextBlock Text="{Binding Name}"
-
FontSize="14"
-
HorizontalAlignment="Center"
-
VerticalAlignment="Center"/>
-
-
<TextBlock Text="{Binding Flag}"
-
Grid.Column="1" Margin="5,0"
-
FontSize="14" Foreground="{DynamicResource S.Brush.Red.Notice}"
-
HorizontalAlignment="Right"
-
VerticalAlignment="Center"/>
-
<Slider Value="{Binding Value}" FontSize="14" Grid.Column="2" Height="30"
-
VerticalContentAlignment="Center"
-
HorizontalAlignment="Stretch" VerticalAlignment="Center"/>
-
-
-
<TextBlock Text="" Grid.Column="3" Style="{DynamicResource FIcon }"
-
Foreground="{DynamicResource S.Brush.Red.Notice}" Visibility="{Binding Message,Converter={x:Static base:XConverter.VisibilityWithOutStringConverter},ConverterParameter={x:Null}}"
-
FontSize="14" TextTrimming="CharacterEllipsis" ToolTip="{Binding Message}"
-
HorizontalAlignment="Center"
-
VerticalAlignment="Center"/>
-
</Grid>
-
</DataTemplate>
-
-
<Style TargetType="local:ObjectPropertyForm">
-
<Setter Property="Background" Value="{DynamicResource S.Brush.TextBackgroud.Default}"/>
-
<Setter Property="BorderThickness" Value="0"/>
-
<!--<Setter Property="BorderBrush" Value="{x:Null}"/>-->
-
<Setter Property="HorizontalAlignment" Value="Stretch"/>
-
<Setter Property="VerticalAlignment" Value="Center"/>
-
<Setter Property="HorizontalContentAlignment" Value="Center"/>
-
<Setter Property="VerticalContentAlignment" Value="Center"/>
-
<!--<Setter Property="FocusVisualStyle" Value="{x:Null}"/>-->
-
<Setter Property="Padding" Value="0" />
-
<Setter Property="Width" Value="500" />
-
<Setter Property="Height" Value="Auto" />
-
<Setter Property="ItemsSource" Value="{Binding PropertyItemSource,Mode=TwoWay}" />
-
<Setter Property="ItemsPanel">
-
<Setter.Value>
-
<ItemsPanelTemplate>
-
<StackPanel/>
-
-
</ItemsPanelTemplate>
-
</Setter.Value>
-
</Setter>
-
<Setter Property="Template">
-
<Setter.Value>
-
<ControlTemplate TargetType="local:ObjectPropertyForm">
-
<GroupBox Header="{TemplateBinding Title}">
-
<Border HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
-
VerticalAlignment="{TemplateBinding VerticalAlignment}"
-
Background="{TemplateBinding Background}"
-
BorderBrush="{TemplateBinding BorderBrush}"
-
BorderThickness="{TemplateBinding BorderThickness}">
-
<ItemsPresenter/>
-
</Border>
-
</GroupBox>
-
</ControlTemplate>
-
</Setter.Value>
-
</Setter>
-
</Style>
4、开放扩展
1、只需定义一个扩展类型,如:
/// <summary> 字符串属性类型 </summary>
public class StringPropertyItem : ObjectPropertyItem<string>
{
public StringPropertyItem(PropertyInfo property, object obj) : base(property, obj)
{
}
}
2、再添加一个DataTmeplate,如:
<DataTemplate DataType="{x:Type base:StringPropertyItem}">
<Grid Width="{Binding RelativeSource={RelativeSource AncestorType=local:ObjectPropertyForm},Path=Width-5}"
Height="35" Margin="5,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="30"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Name}"
FontSize="14"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
<TextBlock Text="{Binding Flag}"
Grid.Column="1" Margin="5,0"
FontSize="14" Foreground="{DynamicResource S.Brush.Red.Notice}"
HorizontalAlignment="Right"
VerticalAlignment="Center"/>
<local:FTextBox Text="{Binding Value,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource DefaultTextBox}"
FontSize="14" Width="Auto" CaretBrush="Black"
Grid.Column="2" Height="30" base:ControlAttachProperty.FIcon=""
VerticalContentAlignment="Center"
HorizontalAlignment="Stretch" VerticalAlignment="Center"/>
<TextBlock Text="" Grid.Column="3" Style="{DynamicResource FIcon }"
Foreground="{DynamicResource S.Brush.Red.Notice}"
Visibility="{Binding Message,Converter={x:Static base:XConverter.VisibilityWithOutStringConverter},ConverterParameter={x:Null},Mode=TwoWay}"
FontSize="14" TextTrimming="CharacterEllipsis" ToolTip="{Binding Message}"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Grid>
</DataTemplate>
下载地址:https://github.com/HeBianGu/WPF-ControlBase.git
示例:WPF开发的简单ObjectProperyForm用来绑定实体表单的更多相关文章
- 3.NetDh框架之缓存操作类和二次开发模式简单设计(附源码和示例代码)
前言 NetDh框架适用于C/S.B/S的服务端框架,可用于项目开发和学习.目前包含以下四个模块 1.数据库操作层封装Dapper,支持多种数据库类型.多库实例,简单强大: 此部分具体说明可参考博客: ...
- [WPF自定义控件库]简单的表单布局控件
1. WPF布局一个表单 <Grid Width="400" HorizontalAlignment="Center" VerticalAlignment ...
- .net core 和 WPF 开发升讯威在线客服与营销系统:使用 TCP协议 实现稳定的客服端
本系列文章详细介绍使用 .net core 和 WPF 开发 升讯威在线客服与营销系统 的过程.本产品已经成熟稳定并投入商用. 在线演示环境:https://kf.shengxunwei.com 注意 ...
- .net core 和 WPF 开发升讯威在线客服与营销系统:实现对 IE8 的完全完美支持 【干货】
本系列文章详细介绍使用 .net core 和 WPF 开发 升讯威在线客服与营销系统 的过程.本产品已经成熟稳定并投入商用. 在线演示环境:https://kf.shengxunwei.com 注意 ...
- .net core 和 WPF 开发升讯威在线客服系统:调用百度翻译接口实现实时自动翻译
业余时间用 .net core 写了一个在线客服系统.并在博客园写了一个系列的文章,写介绍这个开发过程. 我把这款业余时间写的小系统丢在网上,陆续有人找我要私有化版本,我都给了,毕竟软件业的初衷就是免 ...
- .net core 和 WPF 开发升讯威在线客服系统:调用有道翻译接口实现实时自动翻译的方法
业余时间用 .net core 写了一个在线客服系统.并在博客园写了一个系列的文章,写介绍这个开发过程. 我把这款业余时间写的小系统丢在网上,陆续有人找我要私有化版本,我都给了,毕竟软件业的初衷就是免 ...
- .NET Web开发技术简单整理
在最初学习一些编程语言.一些编程技术的时候,做的更多的是如何使用该技术,如何更好的使用该技术解决问题,而没有去关注它的相关性.关注它的理论支持,这种学习技术的方式是短平快.其实工作中有时候也是这样,公 ...
- 工欲善其事,必先利其器 之 WPF篇: 随着开发轨迹来看高效WPF开发的工具和技巧
之前一篇<工欲善其事,必先利其器.VS2013全攻略(安装,技巧,快捷键,插件)!> 看到很多朋友回复和支持,非常感谢,尤其是一些拍砖的喷油,感谢你们的批评,受益良多. 我第一份工作便是W ...
- MVVM开发模式简单实例MVVM Demo
本文主要是翻译Rachel Lim的一篇有关MVVM模式介绍的博文 A Simple MVVM Example 并具体给出了一个简单的Demo(原文是以WPF开发的,对于我自己添加或修改的一部分会用红 ...
随机推荐
- Python之request模块-基础用法
Request模块参考中文手册:https://requests.readthedocs.io/zh_CN/latest/ Request模块 1.查看pip已装包(模块)的安装信息(模块的路径.版本 ...
- Windows Server安装FileZilla服务端
1.下载 地址: https://filezilla-project.org/download.php?type=server 点击下载 2. 安装较为简单, 不详细介绍,下面说配置 2.1 添加用户 ...
- ubuntu,安装、配置和美化(1)
ubuntu linux 1.前言 1.1关于Ubuntu Linux Ubuntu是一个以桌面应用为主的Linux操作系统,其名称来自非洲南部祖鲁语或豪萨语的“ubuntu"一词,意思是“ ...
- Rikka with Travels(2019年杭电多校第九场07题+HDU6686+树形dp)
目录 题目链接 题意 思路 代码 题目链接 传送门 题意 定义\(L(a,b)\)为结点\(a\)到结点\(b\)的路径上的结点数,问有种\(pair(L(a,b),L(c,d))\)取值,其中结点\ ...
- vue-router路由传递参数 + get传值query获取
[步骤] (1)路由配置 或者 (2)传递参数 或者 (3)接收传递参数 或者 [二]步骤小结 [三]参数形式 (1)上面这种是/100形式传递过去 (2)另外还有?count=100的格式,这便是g ...
- WeUI教程/第三方扩展及其他UI框架对比
WeUI 是一套同微信原生视觉体验一致的基础样式库,由微信官方设计团队为微信内网页和微信小程序量身设计,令用户的使用感知更加统一.包含button.cell.dialog. progress. toa ...
- matlab-fsolve函数求解多元非线性方程
记录一下代码,方便下次套用模板 options=optimset('MaxFunEvals',1e4,'MaxIter',1e4); [x,fval,exitflag] = fsolve(@(x) m ...
- Codeforces Beta Round #19
A. World Football Cup #include <bits/stdc++.h> using namespace std; ; char name[N][N]; map&l ...
- Pandas | 28 与SQL比较
由于许多潜在的Pandas用户对SQL有一定的了解,因此本文章旨在提供一些如何使用Pandas执行各种SQL操作的示例. 文件:tips.csv - total_bill,tip,sex,smoker ...
- 在执行一行代码之前CLR做的68件事
因为CLR是一个托管环境,所以运行时中有几个组件需要在执行任何代码之前初始化.本文将介绍EE(执行引擎)启动程序,并详细检查初始化过程.68只是一个粗略的指南,它取决于您使用的运行时版本.启用了哪些功 ...