浏览代码

Final finishing touches to DateFieldControl

Kenric Nugteren 2 月之前
父节点
当前提交
98e88bc3f3
共有 1 个文件被更改,包括 4 次插入9 次删除
  1. 4 9
      PRS.Avalonia/PRS.Avalonia/Components/FormsEditor/Fields/DFDateFieldControl.cs

+ 4 - 9
PRS.Avalonia/PRS.Avalonia/Components/FormsEditor/Fields/DFDateFieldControl.cs

@@ -18,15 +18,10 @@ class DFDateFieldControl : DigitalFormFieldControl<DFLayoutDateField, DFLayoutDa
     protected override Control Create()
     {
         Date = new DateSelectorButton();
-
-        // Date.DateTimeFormat = CultureInfo.CurrentCulture.DateTimeFormat;
-        // Date.Pattern = DateTimePattern.ShortDate;
-        // var def = Field.Properties.Default;
-        // Date.DateTime = def.IsEmpty()
-        //     ? DateTime.Now
-        //     : def;
-        // Date.DateTimeChanged += (sender, e) => ChangeField();
-        // Date.EnableMouseWheelEdit = false;
+        var def = Field.Properties.Default;
+        Date.Date = def.IsEmpty() ? DateTime.Now : def;
+        Date.DateChanged += (sender, e) => ChangeField();
+        
         return Date;
     }