feat: 优化主界面及控件功能
This commit is contained in:
@@ -435,27 +435,23 @@ namespace Lskj.Control.Model
|
||||
{
|
||||
BaseUserControl baseControl = control as BaseUserControl;
|
||||
baseControl.Location = model.Location;
|
||||
System.Threading.SynchronizationContext.Current.Post(SetProperty, null);
|
||||
void SetProperty(object state)
|
||||
// 控件创建、属性设置和挂载必须保持在同一条 UI 线程上,避免 WPF 宿主下 Timer 先执行。
|
||||
baseControl.Model = model;
|
||||
baseControl.FontSize = model.FontSize;
|
||||
baseControl.Name = "txt_" + model.FieldName;
|
||||
baseControl.LabelText = model.LabelText;
|
||||
baseControl.NullText = model.NullText;
|
||||
//baseControl.EditText = model.DefaultValue;
|
||||
//baseControl.Location = model.Location;
|
||||
baseControl.Size = model.Size;
|
||||
if (!model.ReadOnly && !string.IsNullOrWhiteSpace(model.ControlTitleColor))
|
||||
{
|
||||
//放到外面避免线程问题
|
||||
baseControl.Model = model;
|
||||
baseControl.FontSize = model.FontSize;
|
||||
baseControl.Name = "txt_" + model.FieldName;
|
||||
baseControl.LabelText = model.LabelText;
|
||||
baseControl.NullText = model.NullText;
|
||||
//baseControl.EditText = model.DefaultValue;
|
||||
//baseControl.Location = model.Location;
|
||||
baseControl.Size = model.Size;
|
||||
if (!model.ReadOnly && !string.IsNullOrWhiteSpace(model.ControlTitleColor))
|
||||
{
|
||||
baseControl.ModifyDefaultColors(ColorTranslator.FromHtml(model.ControlTitleColor));
|
||||
}
|
||||
baseControl.ReadOnly = model.ReadOnly;
|
||||
baseControl.Required = model.IsEmpty;
|
||||
baseControl.Tag = model;
|
||||
baseControl.TabIndex = model.TabOrder;
|
||||
baseControl.ModifyDefaultColors(ColorTranslator.FromHtml(model.ControlTitleColor));
|
||||
}
|
||||
baseControl.ReadOnly = model.ReadOnly;
|
||||
baseControl.Required = model.IsEmpty;
|
||||
baseControl.Tag = model;
|
||||
baseControl.TabIndex = model.TabOrder;
|
||||
|
||||
for (int i = 0; i < startLocktion.Count; i++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user