public ListModel(IListDomain <T, U, V> domains, string name) { Domains = domains; Name = name; AddCommand = new RelayCommand(delegate(object parameter) { Messenger.Default.Send <W>(null, $"{Name}Add"); }, delegate(object parameter) { return(this != null); }); }
public ListModelQuery(IListDomain <T, U, V> domains, string name, Q query, int maxdepth = 1, int top = 0) : base(domains, name) { _query = query; _maxdepth = maxdepth; RefreshCommand = new RelayCommand(delegate(object parameter) { Messenger.Default.Send <int>(top, $"{Name}Refresh"); }, delegate(object parameter) { return(true); }); TotalRecords(); }
public virtual (Result result, IEnumerable <V> domains) List(IQueryDomain <S, T, U, V> query, int maxdepth = 1, int top = 0, IListDomain <T, U, V> domains = null) { var enumeration = new List <V>(); var selectmultiple = query.Data.Select(maxdepth, top, (domains?.Datas != null ? domains?.Datas : new ListData <T, U>())); if (selectmultiple.result.Success && selectmultiple.datas != null) { foreach (var instance in LoadDatas(selectmultiple.datas, maxdepth)) { instance.Changed = false; instance.Deleted = false; enumeration.Add(instance); } return(selectmultiple.result, enumeration); } return(selectmultiple.result, default(IList <V>)); }
public virtual (Result result, IEnumerable <V> domains) List(int maxdepth = 1, int top = 0, IListDomain <T, U, V> domains = null) { var list = _logic.List(this, maxdepth, top, domains); return(list); }