alielie
2025-08-25 c4a3f8db90530a727ffab77c3bb5bb7d782792bf
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);