本文整理汇总了C#中System.Windows.Controls.DataGridRow.DetachFromDataGrid方法的典型用法代码示例。如果您正苦于以下问题:C# DataGridRow.DetachFromDataGrid方法的具体用法?C# DataGridRow.DetachFromDataGrid怎么用?C# DataGridRow.DetachFromDataGrid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.DataGridRow
的用法示例。
在下文中一共展示了DataGridRow.DetachFromDataGrid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UnloadRow
private void UnloadRow(DataGridRow dataGridRow)
{
Debug.Assert(dataGridRow != null);
Debug.Assert(this._rowsPresenter != null);
Debug.Assert(this._rowsPresenter.Children.Contains(dataGridRow));
if (this._loadedRows.Contains(dataGridRow))
{
return; // The row is still referenced, we can't release it.
}
// Raise UnloadingRow regardless of whether the row will be recycled
OnUnloadingRow(new DataGridRowEventArgs(dataGridRow));
//
bool recycleRow = this.CurrentSlot != dataGridRow.Index;
// Don't recycle if the row has a custom Style set
recycleRow &= (dataGridRow.Style == null || dataGridRow.Style == this.RowStyle);
if (recycleRow)
{
this.DisplayData.AddRecylableRow(dataGridRow);
}
else
{
//
this._rowsPresenter.Children.Remove(dataGridRow);
dataGridRow.DetachFromDataGrid(false);
}
}
示例2: AddRecylableRow
internal void AddRecylableRow(DataGridRow row)
{
Debug.Assert(!_recyclableRows.Contains(row));
row.DetachFromDataGrid(true);
_recyclableRows.Push(row);
}