/// <summary> /// /// </summary> private void QueryGroups() { Application.Current?.Dispatcher.Invoke(() => { this.mTagGroups.Clear(); }); if (!string.IsNullOrEmpty(CurrentDatabase)) { TagGroupViewModel root = null; Application.Current?.Dispatcher.Invoke(() => { root = new TagGroupViewModel() { Database = CurrentDatabase, Name = CurrentDatabase, IsExpended = true, IsSelected = true }; mTagGroups.Add(root); CurrentGroup = root; }); var vv = mHelper.GetTagGroup(CurrentDatabase); if (vv != null) { foreach (var vvv in vv.Where(e => string.IsNullOrEmpty(e.Parent))) { Application.Current?.Dispatcher.Invoke(() => { TagGroupViewModel groupViewModel = new TagGroupViewModel() { Name = vvv.Name, Database = CurrentDatabase, Parent = root }; root.Children.Add(groupViewModel); groupViewModel.InitData(vv); }); } } } }
/// <summary> /// /// </summary> private void QueryGroups() { Application.Current?.Dispatcher.Invoke(() => { this.mTagGroups.Clear(); }); var vv = mHelper.GetTagGroup(CurrentDatabase); if (vv != null) { foreach (var vvv in vv.Where(e => string.IsNullOrEmpty(e.Parent))) { Application.Current?.Dispatcher.Invoke(() => { TagGroupViewModel groupViewModel = new TagGroupViewModel() { Name = vvv.Name, Database = CurrentDatabase }; mTagGroups.Add(groupViewModel); groupViewModel.InitData(vv); }); } } }
private void getTagGroup_Click(object sender, RoutedEventArgs e) { List <string> ltmp = new List <string>(); ltmp.Add(""); var grps = mHelper.GetTagGroup(mCurrentDatabase); if (grps != null) { foreach (var vv in grps) { if (!string.IsNullOrEmpty(vv.Parent)) { ltmp.Add(vv.Parent + "." + vv.Name); } else { ltmp.Add(vv.Name); } } } groupList.ItemsSource = ltmp; }