当前位置: 首页>>代码示例>>C#>>正文


C# ItemCollection.SetItemIndexes方法代码示例

本文整理汇总了C#中ItemCollection.SetItemIndexes方法的典型用法代码示例。如果您正苦于以下问题:C# ItemCollection.SetItemIndexes方法的具体用法?C# ItemCollection.SetItemIndexes怎么用?C# ItemCollection.SetItemIndexes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ItemCollection的用法示例。


在下文中一共展示了ItemCollection.SetItemIndexes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetPreparedItems

 /// <summary>
 /// Called after the collection of items to be displayed has been set up.
 /// </summary>
 /// <param name="setItems">If set to <c>true</c>, the <see cref="Items"/> will be set to the given <paramref name="preparedItems"/>,
 /// else, the <see cref="Items"/> will be left unchanged.</param>
 /// <param name="preparedItems">Elements to be put into the <see cref="Items"/> collection.</param>
 /// <param name="setChildren">If set to <c>true</c>, the children of our host panel will be set to the given
 /// <paramref name="preparedChildren"/>, else, they will be left unchanged.</param>
 /// <param name="preparedChildren">Elements to be put into the <see cref="Panel.Children"/> of our host panel.</param>
 protected void SetPreparedItems(bool setItems, ItemCollection preparedItems, bool setChildren, ItemCollection preparedChildren)
 {
   ItemCollection oldPreparedItems;
   ItemCollection oldPreparedChildren;
   lock (_renderLock)
   {
     oldPreparedItems = _preparedItems;
     oldPreparedChildren = _preparedChildren;
     _preparedItems = preparedItems;
     _preparedChildren = preparedChildren;
     if (_preparedItems != null)
       _preparedItems.SetItemIndexes();
     if (_preparedChildren != null)
       _preparedChildren.SetItemIndexes();
     _setItems = setItems;
     _setChildren = setChildren;
   }
   // If one of those oldXXX properties is set, this method was called multiple times before _preparedItems could be
   // used by UpdatePreparedItems, so dispose old items
   if (oldPreparedItems != null)
     oldPreparedItems.Dispose();
   if (oldPreparedChildren != null)
     oldPreparedChildren.Dispose();
   if (_elementState == ElementState.Preparing)
     // Shortcut in state Preparing - no render thread necessary here to do the UpdatePreparedItems work
     UpdatePreparedItems();
   InvalidateLayout(true, true);
 }
开发者ID:aspik,项目名称:MediaPortal-2,代码行数:37,代码来源:ItemsControl.cs


注:本文中的ItemCollection.SetItemIndexes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。