public virtual Preset Init(IUiFasade uiFasade) { _config = uiFasade.GetViewModelConfig(OwnerMnemonic); IsInit = true; return this; }
public ListBoContractResolver(string mnemonic, IUiFasade uiFasade) { _uiFasade = uiFasade; if (!String.IsNullOrEmpty(mnemonic)) { _config = uiFasade.GetViewModelConfig(mnemonic); _columns = uiFasade.GetColumns(mnemonic); } }
public BoContractResolver(string mnemonic, IUiFasade uiFasade) { _uiFasade = uiFasade; if (!String.IsNullOrEmpty(mnemonic)) { _config = uiFasade.GetViewModelConfig(mnemonic); _editors = uiFasade.GetEditors(mnemonic); } }
public BaseViewModel(BaseViewModel baseViewModel) { _securityUser = baseViewModel.SecurityUser; _uiFasade = baseViewModel.UiFasade; }
public BaseViewModel(IBaseController controller) { _securityUser = controller.SecurityUser; _uiFasade = controller.UiFasade; }
public ContractResolverFactory(ICacheWrapper cache, IUiFasade uiFasade) { _cache = cache; _uiFasade = uiFasade; }
public override Preset Init(IUiFasade uiFasade) { base.Init(uiFasade); var columns = uiFasade.GetColumns(OwnerMnemonic) .Where(x => x.PropertyInfo.IsDefined(typeof(ListViewAttribute), false)).ToList(); if (this.Columns == null) { this.PageSize = OwnerConfig.ListView.DataSource.PageSize; this.Groupable = OwnerConfig.ListView.DataSource.Groups.Groupable; this.Columns = new List<ColumnSetting>(); columns.ForEach(col => { var columnSetting = this.Columns.FirstOrDefault(x => x.Name == col.PropertyName); if (columnSetting == null) { columnSetting = new ColumnSetting(col) { Visible = col.Visible, Width = col.Width, SortOrder = col.Order, }; columnSetting.ID = this.Columns.Count() + 1; this.Columns.Add(columnSetting.Init(col)); } }); } else { bool changeConfig = false; var properties = columns.Select(x => x.PropertyName).ToList(); foreach (var col in this.Columns) { var vm = columns.FirstOrDefault(x => x.PropertyName == col.Name); if (vm == null) { changeConfig = true; break; } properties.Remove(vm.PropertyName); col.Init(vm); } if (changeConfig || properties.Count > 0) { this.Columns = null; return this.Init(uiFasade); } } return this; }