feat: 优化主界面及控件功能

This commit is contained in:
cyf
2026-08-30 12:00:03 +08:00
parent 24653fbe6c
commit 641d3c232d
6 changed files with 300 additions and 40 deletions
+15 -19
View File
@@ -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++)
{