alielie
2025-05-12 7bf89fd93bc487e8445d6d85bb527251b7371a04
Plugin.DOControl/DataModal.xaml.cs
@@ -108,7 +108,7 @@
                Data.ReadOnly = CxReadOnly.IsChecked == true;
                Data.PressDownValue = TbPressDownValue.Text;
                Data.PressUpValue = TbPressUpValue.Text;
                Data.ControlType = (ControlType)int.Parse(CbControlType.SelectedValue.ToString());
                Data.ControlType = (ControlType)CbControlType.SelectedItem;
            }
            return flag;
        }
@@ -124,13 +124,17 @@
            CxReadOnly.IsChecked = Data.ReadOnly;
            TbPressDownValue.Text = Data.PressDownValue;
            TbPressUpValue.Text = Data.PressUpValue;
            CbControlType.SelectedValue = (int)Data.ControlType;
            CbControlType.SelectedItem = Data.ControlType;
            return this.ShowDialog();
        }
        private void SaveOrUpdateData()
        {
            int index = Datasource.IndexOf(Data);
            int index = -1;
            if (Datasource != null)
            {
                index = Datasource.IndexOf(Data);
            }
            if (index < 0)
            {
                InsertData(Data);