本文整理汇总了C#中System.Windows.Controls.ListView.UpdateLayout方法的典型用法代码示例。如果您正苦于以下问题:C# ListView.UpdateLayout方法的具体用法?C# ListView.UpdateLayout怎么用?C# ListView.UpdateLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.ListView
的用法示例。
在下文中一共展示了ListView.UpdateLayout方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AutoResizeColumns
/// <summary>
/// Auto resize columns
/// </summary>
public static void AutoResizeColumns(ListView listView)
{
GridView gv = listView.View as GridView;
if (gv != null)
{
foreach (GridViewColumn gvc in gv.Columns)
{
// Set width to max value because actual width doesn't include margins
gvc.Width = double.MaxValue;
// Set it to NaN to remove white space
gvc.Width = double.NaN;
}
listView.UpdateLayout();
}
}
示例2: AddListView
public void AddListView(IEnumerable<Core.Fragment> ie, int colIndex)
{
if (mainGrid != null)
{
ListView lv = new ListView();
lv.SetValue(Grid.ColumnProperty, colIndex);
lv.SetValue(Grid.RowProperty, 1);
ComboBox cmb = new ComboBox();
cmb.SetValue(Grid.ColumnProperty, colIndex);
cmb.SetValue(Grid.RowProperty, 0);
cmb.SelectionChanged += Cmb_SelectionChanged;
Associate(lv, cmb);
mainGrid.Children.Add(cmb);
mainGrid.Children.Add(lv);
lv.ItemsSource = ie;
listViews.Insert(colIndex, lv);
RefreshMetaKeys(cmb, lv);
lv.UpdateLayout();
}
}