private void DeleteIMarkableHandler(object sender, DeleteIMarkableModelEventArgs e) { if (e.Markable is ItemModel) { int prevIndex = SelectingIndex; ItemModelCollection.Remove(e.Markable); Select(prevIndex); } }
public void Select(ItemModel model) { int selectIndex = -1; if (model != null) { selectIndex = ItemModelCollection.IndexOf(model); } SelectingIndex = selectIndex; }
public void MoveCollection(int idx1, int idx2) { var collection = ModelsComposite.ItemModelManager.ModelCollection; var model1 = ItemModelCollection.ElementAt(idx1); var model2 = ItemModelCollection.ElementAt(idx2); var moveFrom = collection.IndexOf(model1); var moveTo = collection.IndexOf(model2); collection.Move(moveFrom, moveTo); ItemModelCollection.Move(idx1, idx2); }
public void Select(int index) { int selectIndex; if (ItemModelCollection.Count() > index) { selectIndex = index; } else { selectIndex = ItemModelCollection.Count() - 1; } SelectingIndex = selectIndex; }
public void Initialize(ItemBuildControl view) { _view = view; _searchWord = ""; _view.SearchWordBox.Text = ""; GetFilteredCollection(); _view.BindData(this); if (ItemModelCollection.Count() >= 1) { SelectingIndex = -1; SelectingIndex = 0; } else { SelectingIndex = -1; } }