public ConnectionsDataWrapper(UserModel loginedUser, DynamicListData <User> users, UserModelsWrapper usersWrapper) : base(true) { LoginedUser = loginedUser; UsersWrapper = usersWrapper; SearchUsers = users; SearchUsers.CollectionChanged += OnSearchCollectionChanged; LoginedUser.Connections.CollectionChanged += OnRequestsChanged; }
public ConnectionsDataWrapper(UserModel loginedUser, UserModelsWrapper usersWrapper) : base(true) { LoginedUser = loginedUser; UsersWrapper = usersWrapper; //refresh by data from db if (!UsersWrapper.UsersModels.IsEmpty()) { OnUsersAddedChanged(UsersWrapper.UsersModels.Items); if (!LoginedUser.Connections.IsEmpty()) { OnRequestsChanged(LoginedUser.Connections.Items); } } LoginedUser.Connections.CollectionChanged += OnRequestsChanged; UsersWrapper.AddUsers += OnUsersAddedChanged; }