/// <summary> /// Constuctor. /// </summary> /// <param name="viewModelStore">The store this view model belongs to.</param> /// <param name="selectableElements"> /// List of existing elements, that are allowed to be selected. Can be null to specify that /// the is no such restriction needed and that all elements can be selected. /// </param> /// <param name="searchAction">Search action.</param> /// <param name="sortAction">Sort action.</param> public SelectGenericViewModel(ViewModelStore viewModelStore, List <T> selectableElements, GenericSearchDelegate <T> searchAction, GenericSortDelegate <T> sortAction) : base(viewModelStore) { selectElementSearchViewModel = new SelectGenericSearchViewModel <T>(viewModelStore, selectableElements, searchAction, sortAction); selectElementSearchViewModel.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(SubModel_PropertyChanged); this.selectableElements = selectableElements; }
/// <summary> /// Tries to set the selected elements to the given object. Not all sub viewmodels might be /// capable of setting a selection. /// </summary> /// <param name="element">Element to select.</param> public virtual void SetSelectedElement(T element) { SelectGenericSearchViewModel.SetSelectedElement(element); }