ItemCollection ItemCollection ItemCollection ItemCollection Class

定義

保存項目清單,這些項目會構成 ItemsControl 的內容。Holds the list of items that constitute the content of an ItemsControl.

public ref class ItemCollection sealed : System::Windows::Data::CollectionView, System::Collections::IList, System::ComponentModel::ICollectionViewLiveShaping, System::ComponentModel::IEditableCollectionViewAddNewItem, System::ComponentModel::IItemProperties, System::Windows::IWeakEventListener
[System.Windows.Localizability(System.Windows.LocalizationCategory.Ignore)]
public sealed class ItemCollection : System.Windows.Data.CollectionView, System.Collections.IList, System.ComponentModel.ICollectionViewLiveShaping, System.ComponentModel.IEditableCollectionViewAddNewItem, System.ComponentModel.IItemProperties, System.Windows.IWeakEventListener
type ItemCollection = class
    inherit CollectionView
    interface IList
    interface ICollection
    interface IEnumerable
    interface IEditableCollectionViewAddNewItem
    interface IEditableCollectionView
    interface ICollectionViewLiveShaping
    interface IItemProperties
    interface IWeakEventListener
Public NotInheritable Class ItemCollection
Inherits CollectionView
Implements ICollectionViewLiveShaping, IEditableCollectionViewAddNewItem, IItemProperties, IList, IWeakEventListener
繼承
屬性
實作

範例

如果您有ItemsControl,這類ListBox內容時,您可以使用Items屬性來存取ItemCollection,這是一種檢視。If you have an ItemsControl, such as a ListBox that has content, you can use the Items property to access the ItemCollection, which is a view. 因為該檢視,然後您可以使用的檢視相關的功能,例如排序、 篩選和分組。Because it is a view, you can then use the view-related functionalities such as sorting, filtering, and grouping. 請注意,當設定 ItemsSource,檢視作業委派給檢視 ItemsSource 集合。Note that when ItemsSource is set, the view operations delegate to the view over the ItemsSource collection. 因此,ItemCollection 支援排序、 篩選和群組才支援它們的委派的檢視。Therefore, the ItemCollection supports sorting, filtering, and grouping only if the delegated view supported them.

下列範例示範如何排序的內容ListBox名為myListBoxThe following example shows how to sort the content of a ListBox named myListBox. 在此範例中,Content是要排序之屬性的名稱。In this example, Content is the name of the property to sort by.

myListBox.Items.SortDescriptions.Add(
    new SortDescription("Content", ListSortDirection.Descending));
myListBox.Items.SortDescriptions.Add(New SortDescription("Content", ListSortDirection.Descending))

當您這樣做時,檢視可能會或可能不是預設檢視中,根據資料的設定方式享用您ItemsControlWhen you do this, the view might or might not be the default view, depending on how the data is set up on your ItemsControl. 例如,當ItemsSource屬性的繫結至CollectionViewSource,您會取得使用檢視Items屬性不是預設檢視。For example, when the ItemsSource property is bound to a CollectionViewSource, the view that you obtain using the Items property is not the default view.

如果您ItemsControl繫結 (使用ItemsSource屬性),則您可以執行下列命令來取得的預設檢視:If your ItemsControl is bound (you are using the ItemsSource property), then you can do the following to get the default view:

CollectionView myView;
Private myView As CollectionView
myView = (CollectionView)CollectionViewSource.GetDefaultView(myItemsControl.ItemsSource);
myView = CType(CollectionViewSource.GetDefaultView(myItemsControl.ItemsSource), CollectionView)

或者,您可以在其中指定篩選、 排序及群組中的準則XAMLXAML使用CollectionViewSourceAlternately, you can specify filtering, sorting, and grouping criteria in XAMLXAML using CollectionViewSource.

備註

ItemCollection 會維護一組項目,例如字串、 物件、XMLXML節點、 元素和其他集合。ItemCollection maintains a collection of items such as strings, objects, XMLXML nodes, elements, and other collections. ItemsControl使用中的資料ItemCollection來產生其內容。An ItemsControl uses the data in the ItemCollection to generate its content. 如果您想要彙總多個集合,將指派CompositeCollectionItemsSource屬性的程式ItemsControlIf you want to aggregate more than one collection, assign a CompositeCollection to the ItemsSource property of your ItemsControl.

使用任何一種Items屬性或ItemsSource屬性來指定應該用來產生內容的集合您ItemsControlUse either the Items property or the ItemsSource property to specify the collection that should be used to generate the content of your ItemsControl. ItemsSource屬性設定,Items集合會被設為唯讀且固定的大小。When the ItemsSource property is set, the Items collection will be made read-only and fixed-size. 這表示,如果您使用ItemsSource屬性,您無法加入、 刪除或變更項目中的ItemCollection直接。This means that if you are using the ItemsSource property, you cannot add, delete, or change items in the ItemCollection directly.

ItemCollectionCollectionView,因此提供的集合檢視功能,例如排序、 分組和篩選。ItemCollection is a CollectionView and therefore provides collection view functionalities, such as sorting, grouping, and filtering. 如需詳細資訊,請參閱SortDescriptionsFilterGroupDescriptionsFor more information, see SortDescriptions, Filter, and GroupDescriptions.

如需有關集合檢視的詳細資訊,請參閱資料繫結概觀For more information about collection views, see Data Binding Overview.

屬性

AllowsCrossThreadChanges AllowsCrossThreadChanges AllowsCrossThreadChanges AllowsCrossThreadChanges

取得值,指出建立 CollectionView 的執行緒之外的執行緒是否可以變更 SourceCollectionGets a value that indicates whether a thread other than the one that created the CollectionView can change the SourceCollection.

(Inherited from CollectionView)
CanChangeLiveFiltering CanChangeLiveFiltering CanChangeLiveFiltering CanChangeLiveFiltering

取得值,其中該值表示集合檢視是否支援即時開啟或關閉篩選資料。Gets a value that indicates whether the collection view supports turning filtering data in real time on or off.

CanChangeLiveGrouping CanChangeLiveGrouping CanChangeLiveGrouping CanChangeLiveGrouping

取得值,這個值表示這個集合檢視是否支援開啟或關閉即時群組資料功能。Gets a value that indicates whether the collection view supports turning grouping data in real time on or off.

CanChangeLiveSorting CanChangeLiveSorting CanChangeLiveSorting CanChangeLiveSorting

取得值,這個值表示這個集合檢視是否支援開啟或關閉即時排序資料功能。Gets a value that indicates whether the collection view supports turning sorting data in real time on or off.

CanFilter CanFilter CanFilter CanFilter

取得值,這個值表示此集合檢視是否支援篩選。Gets a value that indicates whether this collection view supports filtering.

CanGroup CanGroup CanGroup CanGroup

取得值,這個值表示此集合檢視是否支援群組。Gets a value that indicates whether this collection view supports grouping.

CanSort CanSort CanSort CanSort

取得值,這個值表示此集合檢視是否支援排序。Gets a value that indicates whether this collection view supports sorting.

Comparer Comparer Comparer Comparer

傳回物件,可用來比較檢視中的項目。Returns an object that you can use to compare items in the view.

(Inherited from CollectionView)
Count Count Count Count

取得集合中的記錄數目。Gets the number of records in the collection.

Culture Culture Culture Culture

取得或設定排序期間要使用的文化特性 (Culture) 資訊。Gets or sets the culture information to use during sorting.

(Inherited from CollectionView)
CurrentItem CurrentItem CurrentItem CurrentItem

取得檢視中的目前項目。Gets the current item in the view.

CurrentPosition CurrentPosition CurrentPosition CurrentPosition

取得目前項目在檢視中的序數位置。Gets the ordinal position of the current item within the view.

Dispatcher Dispatcher Dispatcher Dispatcher

取得DispatcherDispatcherObject相關聯。Gets the Dispatcher this DispatcherObject is associated with.

(Inherited from DispatcherObject)
Filter Filter Filter Filter

取得或設定回呼,這個回呼是用來判斷項目是否適合包含在檢視中。Gets or sets a callback used to determine if an item is suitable for inclusion in the view.

GroupDescriptions GroupDescriptions GroupDescriptions GroupDescriptions

取得定義如何群組項目的 GroupDescription 物件集合。Gets a collection of GroupDescription objects that defines how to group the items.

Groups Groups Groups Groups

取得根據 GroupDescriptions 建構的最上層群組。Gets the top-level groups that are constructed according to the GroupDescriptions.

IsCurrentAfterLast IsCurrentAfterLast IsCurrentAfterLast IsCurrentAfterLast

取得值,這個值表示檢視的目前項目是否超過集合的結尾。Gets a value that indicates whether the current item of the view is beyond the end of the collection.

IsCurrentBeforeFirst IsCurrentBeforeFirst IsCurrentBeforeFirst IsCurrentBeforeFirst

取得值,這個值表示檢視的目前項目是否超過集合的開頭。Gets a value that indicates whether the current item of the view is beyond the beginning of the collection.

IsCurrentInSync IsCurrentInSync IsCurrentInSync IsCurrentInSync

取得值,指出 CurrentItem 是否位於 CurrentPositionGets a value that indicates whether the CurrentItem is at the CurrentPosition.

(Inherited from CollectionView)
IsDynamic IsDynamic IsDynamic IsDynamic

取得值,表示基礎集合是否提供變更通知。Gets a value that indicates whether the underlying collection provides change notifications.

(Inherited from CollectionView)
IsEmpty IsEmpty IsEmpty IsEmpty

取得值,這個值表示產生的 (已篩選) 檢視是否為空白。Gets a value that indicates whether the resulting (filtered) view is empty.

IsInUse IsInUse IsInUse IsInUse

取得值,指出是否有任何物件訂閱這個 CollectionView 的事件。Gets a value that indicates whether any object is subscribing to the events of this CollectionView.

(Inherited from CollectionView)
IsLiveFiltering IsLiveFiltering IsLiveFiltering IsLiveFiltering

取得或設定值,指出是否已啟用即時篩選資料。Gets or sets a value that indicates whether filtering data in real time is enabled.

IsLiveGrouping IsLiveGrouping IsLiveGrouping IsLiveGrouping

取得或設定值,指出是否已啟用即時設定資料群組。Gets or sets a value that indicates whether grouping data in real time is enabled.

IsLiveSorting IsLiveSorting IsLiveSorting IsLiveSorting

取得或設定值,指出是否已啟用即時排序。Gets or sets a value that indicates whether sorting in real time is enabled.

IsRefreshDeferred IsRefreshDeferred IsRefreshDeferred IsRefreshDeferred

取得值,指出是否仍然有未處理的 DeferRefresh() 在使用中。Gets a value that indicates whether there is an outstanding DeferRefresh() in use.

(Inherited from CollectionView)
Item[Int32] Item[Int32] Item[Int32] Item[Int32]

取得或設定位於指定之以零起始的索引的項目。Gets or sets the item at the given zero-based index.

LiveFilteringProperties LiveFilteringProperties LiveFilteringProperties LiveFilteringProperties

取得字串集合,這些字串會指定參與即時篩選資料的屬性。Gets a collection of strings that specify the properties that participate in filtering data in real time.

LiveGroupingProperties LiveGroupingProperties LiveGroupingProperties LiveGroupingProperties

取得字串集合,這些字串會指定參與即時篩群組資料的屬性。Gets a collection of strings that specify the properties that participate in grouping data in real time.

LiveSortingProperties LiveSortingProperties LiveSortingProperties LiveSortingProperties

取得字串集合,這些字串會指定參與即時排序資料的屬性。Gets a collection of strings that specify the properties that participate in sorting data in real time.

NeedsRefresh NeedsRefresh NeedsRefresh NeedsRefresh

取得值,這個值表示集合是否需要重新整理。Gets a value that indicates whether the collection needs to be refreshed.

SortDescriptions SortDescriptions SortDescriptions SortDescriptions

取得 SortDescription 物件的集合,這些物件描述如何在檢視中排序集合中的項目。Gets a collection of SortDescription objects that describe how the items in the collection are sorted in the view.

SourceCollection SourceCollection SourceCollection SourceCollection

取得位於此集合檢視下之未排序且未篩選的集合。Gets the unsorted and unfiltered collection that underlies this collection view.

UpdatedOutsideDispatcher UpdatedOutsideDispatcher UpdatedOutsideDispatcher UpdatedOutsideDispatcher

取得值,指出是否已有需要更新變更記錄,因為已經在另一個執行緒上接收到 CollectionChanged 通知,而沒有先進入使用者介面 (UI)user interface (UI) 執行緒發送器。Gets a value that indicates whether it has been necessary to update the change log because a CollectionChanged notification has been received on a different thread without first entering the 使用者介面 (UI)user interface (UI) thread dispatcher.

(Inherited from CollectionView)

方法

Add(Object) Add(Object) Add(Object) Add(Object)

將項目加入至 ItemCollectionAdds an item to the ItemCollection.

CheckAccess() CheckAccess() CheckAccess() CheckAccess()

判斷呼叫的執行緒是否可以存取這個DispatcherObjectDetermines whether the calling thread has access to this DispatcherObject.

(Inherited from DispatcherObject)
Clear() Clear() Clear() Clear()

清除集合並釋放目前集合中所有項目上的參考。Clears the collection and releases the references on all items currently in the collection.

ClearChangeLog() ClearChangeLog() ClearChangeLog() ClearChangeLog()

清除變更記錄中任何暫止的變更。Clears any pending changes from the change log.

(Inherited from CollectionView)
ClearPendingChanges() ClearPendingChanges() ClearPendingChanges() ClearPendingChanges()

清除集合的未處理變更。Clears unprocessed changed to the collection.

(Inherited from CollectionView)
Contains(Object) Contains(Object) Contains(Object) Contains(Object)

傳回值,這個值表示指定的項目是否位於這個檢視中。Returns a value that indicates whether the specified item is in this view.

CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32)

從特定的陣列索引開始,將集合的項目複製到陣列。Copies the elements of the collection to an array, starting at a particular array index.

DeferRefresh() DeferRefresh() DeferRefresh() DeferRefresh()

進入延後循環,您可以用來合併變更到檢視,並且延遲自動重新整理。Enters a defer cycle that you can use to merge changes to the view and delay automatic refresh.

DetachFromSourceCollection() DetachFromSourceCollection() DetachFromSourceCollection() DetachFromSourceCollection()

CollectionView 移除基礎集合的參考。Removes the reference to the underlying collection from the CollectionView.

(Inherited from CollectionView)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

傳回物件,可用來列舉檢視中的項目。Returns an object that you can use to enumerate the items in the view.

(Inherited from CollectionView)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetItemAt(Int32) GetItemAt(Int32) GetItemAt(Int32) GetItemAt(Int32)

傳回此檢視中位於指定之以零起始的索引的項目。Returns the item at the specified zero-based index in this view.

GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
IndexOf(Object) IndexOf(Object) IndexOf(Object) IndexOf(Object)

傳回此集合中的索引,表示指定項目所在的位置。Returns the index in this collection where the specified item is located.

Insert(Int32, Object) Insert(Int32, Object) Insert(Int32, Object) Insert(Int32, Object)

將元素插入至集合中的指定索引處。Inserts an element into the collection at the specified index.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
MoveCurrentTo(Object) MoveCurrentTo(Object) MoveCurrentTo(Object) MoveCurrentTo(Object)

將集合中的指定項目設為 CurrentItemSets the specified item in the collection as the CurrentItem.

MoveCurrentToFirst() MoveCurrentToFirst() MoveCurrentToFirst() MoveCurrentToFirst()

將檢視中的第一個項目設定為 CurrentItemSets the first item in the view as the CurrentItem.

MoveCurrentToLast() MoveCurrentToLast() MoveCurrentToLast() MoveCurrentToLast()

將檢視中的最後一個項目設定為 CurrentItemSets the last item in the view as the CurrentItem.

MoveCurrentToNext() MoveCurrentToNext() MoveCurrentToNext() MoveCurrentToNext()

將檢視中 CurrentItem 後面的項目設定為 CurrentItemSets the item after the CurrentItem in the view as the CurrentItem.

MoveCurrentToPosition(Int32) MoveCurrentToPosition(Int32) MoveCurrentToPosition(Int32) MoveCurrentToPosition(Int32)

將指定索引處的項目設定為檢視中的 CurrentItemSets the item at the specified index to be the CurrentItem in the view.

MoveCurrentToPrevious() MoveCurrentToPrevious() MoveCurrentToPrevious() MoveCurrentToPrevious()

將檢視中 CurrentItem 前面的項目設定為 CurrentItemSets the item before the CurrentItem in the view as the CurrentItem.

OKToChangeCurrent() OKToChangeCurrent() OKToChangeCurrent() OKToChangeCurrent()

傳回值,指出檢視是否可以變更哪一個項目是 CurrentItemReturns a value that indicates whether the view can change which item is the CurrentItem.

(Inherited from CollectionView)
OnAllowsCrossThreadChangesChanged() OnAllowsCrossThreadChangesChanged() OnAllowsCrossThreadChangesChanged() OnAllowsCrossThreadChangesChanged()

發生於 AllowsCrossThreadChanges 屬性變更時。Occurs when the AllowsCrossThreadChanges property changes.

(Inherited from CollectionView)
OnBeginChangeLogging(NotifyCollectionChangedEventArgs) OnBeginChangeLogging(NotifyCollectionChangedEventArgs) OnBeginChangeLogging(NotifyCollectionChangedEventArgs) OnBeginChangeLogging(NotifyCollectionChangedEventArgs)

由基底類別 (Base Class) 呼叫,通知衍生類別,CollectionChanged 事件已經公佈到訊息佇列。Called by the base class to notify the derived class that an CollectionChanged event has been posted to the message queue.

(Inherited from CollectionView)
OnCollectionChanged(NotifyCollectionChangedEventArgs) OnCollectionChanged(NotifyCollectionChangedEventArgs) OnCollectionChanged(NotifyCollectionChangedEventArgs) OnCollectionChanged(NotifyCollectionChangedEventArgs)

引發 CollectionChanged 事件。Raises the CollectionChanged event.

(Inherited from CollectionView)
OnCollectionChanged(Object, NotifyCollectionChangedEventArgs) OnCollectionChanged(Object, NotifyCollectionChangedEventArgs) OnCollectionChanged(Object, NotifyCollectionChangedEventArgs) OnCollectionChanged(Object, NotifyCollectionChangedEventArgs)

引發 CollectionChanged 事件。Raises the CollectionChanged event.

(Inherited from CollectionView)
OnCurrentChanged() OnCurrentChanged() OnCurrentChanged() OnCurrentChanged()

引發 CurrentChanged 事件。Raises the CurrentChanged event.

(Inherited from CollectionView)
OnCurrentChanging() OnCurrentChanging() OnCurrentChanging() OnCurrentChanging()

引發 CurrentChanging 事件,此事件無法取消。Raises a CurrentChanging event that is not cancelable.

(Inherited from CollectionView)
OnCurrentChanging(CurrentChangingEventArgs) OnCurrentChanging(CurrentChangingEventArgs) OnCurrentChanging(CurrentChangingEventArgs) OnCurrentChanging(CurrentChangingEventArgs)

使用指定的引數,引發 CurrentChanging 事件。Raises the CurrentChanging event with the specified arguments.

(Inherited from CollectionView)
OnPropertyChanged(PropertyChangedEventArgs) OnPropertyChanged(PropertyChangedEventArgs) OnPropertyChanged(PropertyChangedEventArgs) OnPropertyChanged(PropertyChangedEventArgs)

使用指定的引數,引發 PropertyChanged 事件。Raises the PropertyChanged event using the specified arguments.

(Inherited from CollectionView)
PassesFilter(Object) PassesFilter(Object) PassesFilter(Object) PassesFilter(Object)

傳回值,這個值表示指定的項目是否屬於這個檢視。Returns a value that indicates whether the specified item belongs to this view.

ProcessCollectionChanged(NotifyCollectionChangedEventArgs) ProcessCollectionChanged(NotifyCollectionChangedEventArgs) ProcessCollectionChanged(NotifyCollectionChangedEventArgs) ProcessCollectionChanged(NotifyCollectionChangedEventArgs)

在衍生類別中覆寫時,在 UIUI 執行緒上處理單一變更。When overridden in a derived class, processes a single change on the UIUI thread.

(Inherited from CollectionView)
ProcessPendingChanges() ProcessPendingChanges() ProcessPendingChanges() ProcessPendingChanges()

確認已認可對集合的所有暫止變更。Ensures that all pending changes to the collection have been committed.

(Inherited from CollectionView)
Refresh() Refresh() Refresh() Refresh()

重新建立檢視。Re-creates the view.

(Inherited from CollectionView)
RefreshOrDefer() RefreshOrDefer() RefreshOrDefer() RefreshOrDefer()

重新整理檢視,或是指定檢視在延後循環完成時需要重新整理。Refreshes the view or specifies that the view needs to be refreshed when the defer cycle completes.

(Inherited from CollectionView)
RefreshOverride() RefreshOverride() RefreshOverride() RefreshOverride()

重新建立檢視。Re-creates the view.

(Inherited from CollectionView)
Remove(Object) Remove(Object) Remove(Object) Remove(Object)

從集合或檢視中移除指定的項目參考。Removes the specified item reference from the collection or view.

RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32)

從集合或檢視移除位於指定索引的項目。Removes the item at the specified index of the collection or view.

SetCurrent(Object, Int32) SetCurrent(Object, Int32) SetCurrent(Object, Int32) SetCurrent(Object, Int32)

將指定的項目與索引設定為 CurrentItemCurrentPosition 屬性的值。Sets the specified item and index as the values of the CurrentItem and CurrentPosition properties.

(Inherited from CollectionView)
SetCurrent(Object, Int32, Int32) SetCurrent(Object, Int32, Int32) SetCurrent(Object, Int32, Int32) SetCurrent(Object, Int32, Int32)

將指定的項目與索引設定為 CurrentItemCurrentPosition 屬性的值。Sets the specified item and index as the values of the CurrentItem and CurrentPosition properties. 這個方法可從衍生類別的建構函式呼叫。This method can be called from a constructor of a derived class.

(Inherited from CollectionView)
ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)
VerifyAccess() VerifyAccess() VerifyAccess() VerifyAccess()

強制執行呼叫的執行緒可以存取這個DispatcherObjectEnforces that the calling thread has access to this DispatcherObject.

(Inherited from DispatcherObject)

明確介面實作

ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized

這個成員支援 Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 基礎結構,但是您不可以從程式碼直接使用它。This member supports the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.

ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot

這個成員支援 Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 基礎結構,但是您不可以從程式碼直接使用它。This member supports the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.

IEditableCollectionView.AddNew() IEditableCollectionView.AddNew() IEditableCollectionView.AddNew() IEditableCollectionView.AddNew()

將新項目加入至集合中。Adds a new item to the collection.

IEditableCollectionView.CanAddNew IEditableCollectionView.CanAddNew IEditableCollectionView.CanAddNew IEditableCollectionView.CanAddNew

取得值,這個值表示新項目是否可以加入至此集合。Gets a value that indicates whether a new item can be added to the collection.

IEditableCollectionView.CanCancelEdit IEditableCollectionView.CanCancelEdit IEditableCollectionView.CanCancelEdit IEditableCollectionView.CanCancelEdit

取得值,這個值表示集合檢視是否可以捨棄暫止的變更,並還原已編輯物件的原始值。Gets a value that indicates whether the collection view can discard pending changes and restore the original values of an edited object.

IEditableCollectionView.CancelEdit() IEditableCollectionView.CancelEdit() IEditableCollectionView.CancelEdit() IEditableCollectionView.CancelEdit()

結束編輯異動,並在可能情況下還原項目的原始值。Ends the edit transaction and, if possible, restores the original value to the item.

IEditableCollectionView.CancelNew() IEditableCollectionView.CancelNew() IEditableCollectionView.CancelNew() IEditableCollectionView.CancelNew()

結束加入異動並捨棄暫止的新項目。Ends the add transaction and discards the pending new item.

IEditableCollectionView.CanRemove IEditableCollectionView.CanRemove IEditableCollectionView.CanRemove IEditableCollectionView.CanRemove

取得值,這個值表示是否可以從集合中移除某個項目。Gets a value that indicates whether an item can be removed from the collection.

IEditableCollectionView.CommitEdit() IEditableCollectionView.CommitEdit() IEditableCollectionView.CommitEdit() IEditableCollectionView.CommitEdit()

結束編輯異動並儲存暫止的變更。Ends the edit transaction and saves the pending changes.

IEditableCollectionView.CommitNew() IEditableCollectionView.CommitNew() IEditableCollectionView.CommitNew() IEditableCollectionView.CommitNew()

結束加入異動並儲存暫止的新項目。Ends the add transaction and saves the pending new item.

IEditableCollectionView.CurrentAddItem IEditableCollectionView.CurrentAddItem IEditableCollectionView.CurrentAddItem IEditableCollectionView.CurrentAddItem

取得要在目前加入異動期間加入的項目。Gets the item that is being added during the current add transaction.

IEditableCollectionView.CurrentEditItem IEditableCollectionView.CurrentEditItem IEditableCollectionView.CurrentEditItem IEditableCollectionView.CurrentEditItem

取得集合內將被編輯的項目。Gets the item in the collection that is being edited.

IEditableCollectionView.EditItem(Object) IEditableCollectionView.EditItem(Object) IEditableCollectionView.EditItem(Object) IEditableCollectionView.EditItem(Object)

開始指定之項目的編輯異動。Begins an edit transaction of the specified item.

IEditableCollectionView.IsAddingNew IEditableCollectionView.IsAddingNew IEditableCollectionView.IsAddingNew IEditableCollectionView.IsAddingNew

取得值,這個值表示加入異動是否正在進行中。Gets a value that indicates whether an add transaction is in progress.

IEditableCollectionView.IsEditingItem IEditableCollectionView.IsEditingItem IEditableCollectionView.IsEditingItem IEditableCollectionView.IsEditingItem

取得值,這個值表示編輯異動是否正在進行中。Gets a value that indicates whether an edit transaction is in progress.

IEditableCollectionView.NewItemPlaceholderPosition IEditableCollectionView.NewItemPlaceholderPosition IEditableCollectionView.NewItemPlaceholderPosition IEditableCollectionView.NewItemPlaceholderPosition

取得或設定集合檢視中新項目預留位置 (Placeholder) 的位置 (Position)。Gets or sets the position of the new item placeholder in the collection view.

IEditableCollectionView.Remove(Object) IEditableCollectionView.Remove(Object) IEditableCollectionView.Remove(Object) IEditableCollectionView.Remove(Object)

從集合中移除指定的項目。Removes the specified item from the collection.

IEditableCollectionView.RemoveAt(Int32) IEditableCollectionView.RemoveAt(Int32) IEditableCollectionView.RemoveAt(Int32) IEditableCollectionView.RemoveAt(Int32)

從集合中移除指定位置上的項目。Removes the item at the specified position from the collection.

IEditableCollectionViewAddNewItem.AddNewItem(Object) IEditableCollectionViewAddNewItem.AddNewItem(Object) IEditableCollectionViewAddNewItem.AddNewItem(Object) IEditableCollectionViewAddNewItem.AddNewItem(Object)

將指定的物件加入至集合。Adds the specified object to the collection.

IEditableCollectionViewAddNewItem.CanAddNewItem IEditableCollectionViewAddNewItem.CanAddNewItem IEditableCollectionViewAddNewItem.CanAddNewItem IEditableCollectionViewAddNewItem.CanAddNewItem

取得值,這個值表示指定的物件是否可以加入至此集合。Gets a value that indicates whether a specified object can be added to the collection.

IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()

傳回 IEnumerator 物件,可用來列舉檢視中的項目。Returns an IEnumerator object that you can use to enumerate the items in the view.

(Inherited from CollectionView)
IItemProperties.ItemProperties IItemProperties.ItemProperties IItemProperties.ItemProperties IItemProperties.ItemProperties

取得集合,其中包含可在集合的項目上取得之屬性的相關資訊。Gets a collection that contains information about the properties that are available on the items in a collection.

IList.IsFixedSize IList.IsFixedSize IList.IsFixedSize IList.IsFixedSize

這個成員支援 Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 基礎結構,但是您不可以從程式碼直接使用它。This member supports the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.

IList.IsReadOnly IList.IsReadOnly IList.IsReadOnly IList.IsReadOnly

這個成員支援 Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 基礎結構,但是您不可以從程式碼直接使用它。This member supports the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.

IWeakEventListener.ReceiveWeakEvent(Type, Object, EventArgs) IWeakEventListener.ReceiveWeakEvent(Type, Object, EventArgs) IWeakEventListener.ReceiveWeakEvent(Type, Object, EventArgs) IWeakEventListener.ReceiveWeakEvent(Type, Object, EventArgs)

從集中式事件管理員接收事件。Receives events from the centralized event manager.

事件

CollectionChanged CollectionChanged CollectionChanged CollectionChanged

發生於檢視變更時。Occurs when the view has changed.

(Inherited from CollectionView)
CurrentChanged CurrentChanged CurrentChanged CurrentChanged

發生在 CurrentItem 已經變更之後。Occurs after the CurrentItem has changed.

(Inherited from CollectionView)
CurrentChanging CurrentChanging CurrentChanging CurrentChanging

發生在 CurrentItem 正在變更時。Occurs when the CurrentItem is changing.

(Inherited from CollectionView)
INotifyCollectionChanged.CollectionChanged INotifyCollectionChanged.CollectionChanged INotifyCollectionChanged.CollectionChanged INotifyCollectionChanged.CollectionChanged

發生於檢視變更時。Occurs when the view has changed.

(Inherited from CollectionView)
INotifyPropertyChanged.PropertyChanged INotifyPropertyChanged.PropertyChanged INotifyPropertyChanged.PropertyChanged INotifyPropertyChanged.PropertyChanged

當屬性值變更時發生。Occurs when a property value changes.

(Inherited from CollectionView)
PropertyChanged PropertyChanged PropertyChanged PropertyChanged

在屬性值已經變更時發生。Occurs when a property value has changed.

(Inherited from CollectionView)

Extension Methods

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

IEnumerable 的項目轉換成指定的型別。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

根據指定的型別來篩選 IEnumerable 的項目。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

啟用查詢的平行化作業。Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

將轉換IEnumerableIQueryableConverts an IEnumerable to an IQueryable.

適用於

另請參閱