private void AddItem() { var arr = Enum.GetValues(typeof(StatisticTypes)) as StatisticTypes[]; List <StaticItem> itemList = new List <StaticItem>(); for (int i = 0; i < arr.Length; i++) { StaticItem item = new StaticItem(); item.UC = GetUC(arr[i]); if (item.UC == null) { continue; } item.Title = item.UC.Tag.ToString(); itemList.Add(item); } flowLayout.ItemsSource = itemList; }
private void GroupBox_StateChanged(object sender, DevExpress.Xpf.Core.ValueChangedEventArgs <GroupBoxState> e) { DevExpress.Xpf.LayoutControl.GroupBox group = sender as DevExpress.Xpf.LayoutControl.GroupBox; StaticItem item = group.DataContext as StaticItem; IStatisticObject uc = null; if (item != null && item.UC != null) { uc = item.UC as IStatisticObject; } if (group.State == GroupBoxState.Maximized) { uc.ShowLegend = true; } if (group.State == GroupBoxState.Normal) { uc.ShowLegend = false; } }