| | |
| | | using DevExpress.Xpo.Helpers; |
| | | using DevExpress.Utils; |
| | | using DevExpress.Utils.Win; |
| | | using DevExpress.Xpo.Helpers; |
| | | using DevExpress.XtraEditors; |
| | | using DevExpress.XtraEditors.Controls; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | |
| | | public HydroWorkingListViewCtrl() |
| | | { |
| | | InitializeComponent(); |
| | | this.listBoxControl1.InitialDefaultSettings(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 边框可见性 |
| | | /// </summary> |
| | | public bool BorderVisible |
| | | { |
| | | get |
| | | { |
| | | return this.imageListBoxControl1.BorderStyle != BorderStyles.NoBorder; |
| | | } |
| | | set |
| | | { |
| | | this.imageListBoxControl1.BorderStyle = value ? BorderStyles.Default : BorderStyles.NoBorder; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | public void SetBindingData(List<HydroWorkingVmo> allWorkingList) |
| | | { |
| | | _allBindingList = new List<HydroWorkingListItemViewModel>(); |
| | | allWorkingList?.OrderBy(x => x.SortCode).ToList().ForEach(x => _allBindingList.Add(new HydroWorkingListItemViewModel(x))); |
| | | allWorkingList?.OrderBy(x => x.SortCode).ToList() |
| | | .ForEach(x => _allBindingList.Add(new HydroWorkingListItemViewModel(x))); |
| | | this.hydroWorkingListItemViewModelBindingSource.DataSource = _allBindingList; |
| | | this.hydroWorkingListItemViewModelBindingSource.ResetBindings(false); |
| | | } |
| | | |
| | | //选择改变 |
| | | private void listBoxControl1_SelectedValueChanged(object sender, EventArgs e) |
| | | private void imageListBoxControl1_SelectedValueChanged(object sender, EventArgs e) |
| | | { |
| | | if (_allBindingList == null) |
| | | { |
| | | return; |
| | | } |
| | | var item = this.listBoxControl1.SelectedItem; |
| | | var item = this.imageListBoxControl1.SelectedItem; |
| | | var vm = item as HydroWorkingListItemViewModel; |
| | | if (vm == null) |
| | | { |
| | |
| | | this.SelectedChangedEvent?.Invoke(vm.Vmo); |
| | | } |
| | | |
| | | private void toolTipController1_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e) |
| | | { |
| | | if (e.SelectedControl == this.imageListBoxControl1) |
| | | { |
| | | //e.Info = new ToolTipControlInfo(item, tooltipText); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |