小编Ste*_*phy的帖子

将具有重复值的两个List <int>相交

我有两个int类型的列表:

List<int> list1 = new List<int> {12,55,55,55,34};
List<int> list2 = new List<int> {12,55};
Run Code Online (Sandbox Code Playgroud)

如果我将list1与list2相交,那么预期的结果是{12,55,55,55}.

我怎样才能做到这一点?是否还有其他方法可以达到同样的效果?

c#

1
推荐指数
1
解决办法
1105
查看次数

使扩展器控件标头变为粗体

我将在运行时动态创建n扩展器控件,如下所示,

theExpanderCaption[counter] = new TextBlock();
theExpanderCaption[counter].FontWeight = FontWeights.Bold;
theExpanderCaption[counter].Text = ITEMIMP.DataConstants.GroupIds.GetGroupCaption(group.GroupId);

theGroupExpander[counter] = new Expander();
theGroupExpander[counter].Header = theExpanderCaption[counter];
theGroupExpander[counter].Margin = new Thickness(10);
theGroupExpander[counter].HorizontalAlignment = HorizontalAlignment.Left;
theGroupExpander[counter].IsExpanded = true;
theGroupExpander[counter].Content = this.theGroupGrids[counter];
theGroupExpander[counter].Style = null;
Run Code Online (Sandbox Code Playgroud)

在上面的代码中,我使用文本块数组来设置扩展器头(使其变为粗体).这里的缺点是我必须使用n no 文本块控件.有没有其他方法来实现这一目标?

c# wpf expander

0
推荐指数
2
解决办法
1426
查看次数

标签 统计

c# ×2

expander ×1

wpf ×1