public CoordinateSystemCategory(CoordinateSystemCategory parent) : base(parent) { _children = new ObservableCollection <CoordinateSystemTreeNode>(); Children = CollectionViewSource.GetDefaultView(_children); ((ListCollectionView)Children).CustomSort = CoordinateSystemComparer.NonGeneric; ((ListCollectionView)Children).Filter = (o) => o is CoordinateSystemTreeNode node && (node.Parent == null || IsNoFilter(Filter) || node.Matches(Filter) || node.HasChildMatching(Filter)); }
private void AddCategory(string[] categories, CoordinateSystemListEntry coordinateSystem) { var category = Categories.FirstOrDefault(i => (string)i.Name == categories[0]); if (category == null) { category = new CoordinateSystemCategory(this) { NodeObject = categories[0] }; _children.Add(category); } category.Add(categories.Skip(1).ToArray(), coordinateSystem); }
public async static Task <ICollectionView> Build(CoordinateSystemFilter filter) { var root = new CoordinateSystemCategory(null) { NodeObject = "root" }; var coordinateSystems = await QueuedTask.Run(() => { return(GeometryEngine.Instance.GetPredefinedCoordinateSystemList(filter)); }); foreach (var coordinateSystem in coordinateSystems) { root.Add(coordinateSystem.Category.Split('/'), coordinateSystem); } return(root.Children); // ignoring root node }
public CoordinateSystemItem(CoordinateSystemCategory parent) : base(parent) { }