private void UpdateCategoriesSorting() { if (Model == null) { return; } KeywordCategory category = (KeywordCategory)((ImageComboBoxItem)this.cbSelectCategories.SelectedItem).Value; switch (category) { case KeywordCategory.Categorized: this.tlCategories.ParentFieldName = "ParentId"; this.tlcText.FieldName = "Text"; this.tlAddCount.SortOrder = SortOrder.None; this.tlcTimeStamp.SortOrder = SortOrder.None; this.tlCategories.DataSource = Model.GetTagNodeList(TagType); break; case KeywordCategory.MostAdded: this.tlcText.FieldName = "Value"; this.tlCategories.ParentFieldName = ""; this.tlAddCount.SortOrder = SortOrder.Descending; this.tlcTimeStamp.SortOrder = SortOrder.None; this.tlCategories.DataSource = Model.GetTagList(TagType); break; case KeywordCategory.RecentlyAdded: this.tlcText.FieldName = "Value"; this.tlCategories.ParentFieldName = ""; this.tlAddCount.SortOrder = SortOrder.None; this.tlcTimeStamp.SortOrder = SortOrder.Descending; this.tlCategories.DataSource = Model.GetTagList(TagType); break; } this.tlCategories.ExpandAll(); }
private void OnModelChaged() { TreeList.DataSource = Model.GetTagNodeList(TagType); }