我有两个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}.
我怎样才能做到这一点?是否还有其他方法可以达到同样的效果?
我将在运行时动态创建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 文本块控件.有没有其他方法来实现这一目标?