using DevExpress.Utils.Layout; using DevExpress.XtraEditors; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Controls; using System.Windows.Forms; using Yw.WinFrmUI; namespace Yw.WinFrmUI { public partial class SetWaterboxCalcuPrefixListCtrl : DevExpress.XtraEditors.XtraUserControl, Yw.WinFrmUI.IWizardPage { public SetWaterboxCalcuPrefixListCtrl() { InitializeComponent(); } /// /// 页面状态发生改变 /// public event Action PageStateChangedEvent; private SetHydroCalcuPrefixViewModel _vm = null; private List _allCalcuPrefixCtrlList = null; /// /// 初始化页面 /// public void InitialPage(SetHydroCalcuPrefixViewModel vm) { _vm = vm; InitialControls(); } //初始化控件 private void InitialControls() { if (_vm == null) { return; } if (_allCalcuPrefixCtrlList == null) { _allCalcuPrefixCtrlList = new List(); this.tabPanelCore.Columns.Add(new TablePanelColumn(TablePanelEntityStyle.Relative, 55F)); if (_vm.HydroInfo.Waterboxs != null && _vm.HydroInfo.Waterboxs.Count > 0) { for (int i = 0; i < _vm.HydroInfo.Waterboxs.Count; i++) { this.tabPanelCore.Rows.Add(new TablePanelRow(TablePanelEntityStyle.AutoSize, 150F)); var ctrl = new SetWaterboxCalcuPrefixCtrl(); // ctrl.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; ctrl.SetBindingData(_vm.HydroInfo.Waterboxs[i]); //ctrl.Size = new Size(); this.tabPanelCore.Controls.Add(ctrl); this.tabPanelCore.SetCell(ctrl, i, 0); } this.tabPanelCore.Rows.Add(new TablePanelRow(TablePanelEntityStyle.AutoSize, 150F)); } } } //允许上一步 public bool AllowPrev { get { if (_vm == null) { return false; } if (_vm.FirstPage == this) { return false; } return true; } } //允许上一步 public bool AllowNext { get { if (_vm == null) { return false; } if (_vm.LastPage == this) { return false; } return true; } } //允许取消 public bool AllowCancel { get { return true; } } //允许完成 public bool AllowComplete { get { return true; } } public bool CanPrev() { return true; } public bool CanNext() { return true; } public bool CanCancel() { return true; } public bool CanComplete() { return true; } } }