ObservableCollection<T>, INotifyPropertyChanged Interface 프로그래밍/WPF2016. 10. 15. 18:18
ObservableCollection<T> 클래스
https://msdn.microsoft.com/ko-kr/library/ms668604(v=vs.110).aspx
Represents a dynamic data collection that provides notifications when items get added, removed, or when the whole list is refreshed.
어셈블리: System(System.dll에 있음)
System.Collections.ObjectModel.Collection<T>
System.Collections.ObjectModel.ObservableCollection<T>
System.Data.Services.Client.DataServiceCollection<T>
System.Windows.Controls.CalendarBlackoutDatesCollection
System.Windows.Controls.GridViewColumnCollection
System.Windows.Controls.SelectedDatesCollection
이름 | 설명 | |
---|---|---|
ObservableCollection<T>() | Initializes a new instance of the ObservableCollection<T> class. | |
ObservableCollection<T>(IEnumerable<T>) | Initializes a new instance of the ObservableCollection<T> class that contains elements copied from the specified collection. | |
ObservableCollection<T>(List<T>) | Initializes a new instance of the ObservableCollection<T> class that contains elements copied from the specified list. |
이름 | 설명 | |
---|---|---|
Count | Gets the number of elements actually contained in the Collection<T>.(Collection<T>에서 상속됨) | |
Item[Int32] | Gets or sets the element at the specified index.(Collection<T>에서 상속됨) | |
Items | Gets a IList<T> wrapper around the Collection<T>.(Collection<T>에서 상속됨) |
이름 | 설명 | |
---|---|---|
Add(T) | Adds an object to the end of the Collection<T>.(Collection<T>에서 상속됨) | |
BlockReentrancy() | Disallows reentrant attempts to change this collection. | |
CheckReentrancy() | Checks for reentrant attempts to change this collection. | |
Clear() | Removes all elements from the Collection<T>.(Collection<T>에서 상속됨) | |
ClearItems() | Removes all items from the collection.(Collection<T>.ClearItems()을(를) 재정의함) | |
Contains(T) | Determines whether an element is in the Collection<T>.(Collection<T>에서 상속됨) | |
CopyTo(T[], Int32) | Copies the entire Collection<T> to a compatible one-dimensional Array, starting at the specified index of the target array.(Collection<T>에서 상속됨) | |
Equals(Object) | Determines whether the specified object is equal to the current object.(Object에서 상속됨) | |
Finalize() | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Object에서 상속됨) | |
GetEnumerator() | Returns an enumerator that iterates through the Collection<T>.(Collection<T>에서 상속됨) | |
GetHashCode() | Serves as the default hash function.(Object에서 상속됨) | |
GetType() | ||
IndexOf(T) | Searches for the specified object and returns the zero-based index of the first occurrence within the entire Collection<T>.(Collection<T>에서 상속됨) | |
Insert(Int32, T) | Inserts an element into the Collection<T> at the specified index.(Collection<T>에서 상속됨) | |
InsertItem(Int32, T) | Inserts an item into the collection at the specified index.(Collection<T>.InsertItem(Int32, T)을(를) 재정의함) | |
MemberwiseClone() | ||
Move(Int32, Int32) | Moves the item at the specified index to a new location in the collection. | |
MoveItem(Int32, Int32) | Moves the item at the specified index to a new location in the collection. | |
OnCollectionChanged(NotifyCollectionChangedEventArgs) | Raises the CollectionChanged event with the provided arguments. | |
OnPropertyChanged(PropertyChangedEventArgs) | Raises the PropertyChanged event with the provided arguments. | |
Remove(T) | Removes the first occurrence of a specific object from the Collection<T>.(Collection<T>에서 상속됨) | |
RemoveAt(Int32) | Removes the element at the specified index of the Collection<T>.(Collection<T>에서 상속됨) | |
RemoveItem(Int32) | Removes the item at the specified index of the collection.(Collection<T>.RemoveItem(Int32)을(를) 재정의함) | |
SetItem(Int32, T) | Replaces the element at the specified index.(Collection<T>.SetItem(Int32, T)을(를) 재정의함) | |
ToString() | Returns a string that represents the current object.(Object에서 상속됨) |
이름 | 설명 | |
---|---|---|
CollectionChanged | Occurs when an item is added, removed, changed, moved, or the entire list is refreshed. | |
PropertyChanged | Occurs when a property value changes. |
이름 | 설명 | |
---|---|---|
INotifyPropertyChanged.PropertyChanged | Occurs when a property value changes. | |
ICollection.CopyTo(Array, Int32) | Copies the elements of the ICollection to an Array, starting at a particular Array index.(Collection<T>에서 상속됨) | |
IEnumerable.GetEnumerator() | Returns an enumerator that iterates through a collection.(Collection<T>에서 상속됨) | |
IList.Add(Object) | Adds an item to the IList.(Collection<T>에서 상속됨) | |
IList.Contains(Object) | Determines whether the IList contains a specific value.(Collection<T>에서 상속됨) | |
IList.IndexOf(Object) | Determines the index of a specific item in the IList.(Collection<T>에서 상속됨) | |
IList.Insert(Int32, Object) | Inserts an item into the IList at the specified index.(Collection<T>에서 상속됨) | |
IList.Remove(Object) | Removes the first occurrence of a specific object from the IList.(Collection<T>에서 상속됨) | |
ICollection<T>.IsReadOnly | Gets a value indicating whether the ICollection<T> is read-only.(Collection<T>에서 상속됨) | |
ICollection.IsSynchronized | Gets a value indicating whether access to the ICollection is synchronized (thread safe).(Collection<T>에서 상속됨) | |
ICollection.SyncRoot | Gets an object that can be used to synchronize access to the ICollection.(Collection<T>에서 상속됨) | |
IList.IsFixedSize | Gets a value indicating whether the IList has a fixed size.(Collection<T>에서 상속됨) | |
IList.IsReadOnly | Gets a value indicating whether the IList is read-only.(Collection<T>에서 상속됨) | |
IList.Item[Int32] | Gets or sets the element at the specified index.(Collection<T>에서 상속됨) |
이름 | 설명 | |
---|---|---|
Aggregate<T>(Func<T, T, T>) | 오버로드되었습니다. Applies an accumulator function over a sequence.(Enumerable에서 정의됨) | |
Aggregate<T, TAccumulate>(TAccumulate, Func<TAccumulate, T, TAccumulate>) | 오버로드되었습니다. Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value.(Enumerable에서 정의됨) | |
Aggregate<T, TAccumulate, TResult>(TAccumulate, Func<TAccumulate, T, TAccumulate>, Func<TAccumulate, TResult>) | 오버로드되었습니다. Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value, and the specified function is used to select the result value.(Enumerable에서 정의됨) | |
All<T>(Func<T, Boolean>) | Determines whether all elements of a sequence satisfy a condition.(Enumerable에서 정의됨) | |
Any<T>() | 오버로드되었습니다. Determines whether a sequence contains any elements.(Enumerable에서 정의됨) | |
Any<T>(Func<T, Boolean>) | 오버로드되었습니다. Determines whether any element of a sequence satisfies a condition.(Enumerable에서 정의됨) | |
AsEnumerable<T>() | Returns the input typed as IEnumerable<T>.(Enumerable에서 정의됨) | |
AsParallel() | 오버로드되었습니다. Enables parallelization of a query.(ParallelEnumerable에서 정의됨) | |
AsParallel<T>() | 오버로드되었습니다. Enables parallelization of a query.(ParallelEnumerable에서 정의됨) | |
AsQueryable() | 오버로드되었습니다. Converts an IEnumerable to an IQueryable.(Queryable에서 정의됨) | |
AsQueryable<T>() | 오버로드되었습니다. Converts a generic IEnumerable<T> to a generic IQueryable<T>.(Queryable에서 정의됨) | |
Average<T>(Func<T, Decimal>) | 오버로드되었습니다. Computes the average of a sequence of Decimal values that are obtained by invoking a transform function on each element of the input sequence.(Enumerable에서 정의됨) | |
Average<T>(Func<T, Double>) | 오버로드되었습니다. Computes the average of a sequence of Double values that are obtained by invoking a transform function on each element of the input sequence.(Enumerable에서 정의됨) | |
Average<T>(Func<T, Int32>) | 오버로드되었습니다. Computes the average of a sequence of Int32 values that are obtained by invoking a transform function on each element of the input sequence.(Enumerable에서 정의됨) | |
Average<T>(Func<T, Int64>) | 오버로드되었습니다. Computes the average of a sequence of Int64 values that are obtained by invoking a transform function on each element of the input sequence.(Enumerable에서 정의됨) | |
Average<T>(Func<T, Nullable<Decimal>>) | 오버로드되었습니다. Computes the average of a sequence of nullable Decimalvalues that are obtained by invoking a transform function on each element of the input sequence.(Enumerable에서 정의됨) | |
Average<T>(Func<T, Nullable<Double>>) | 오버로드되었습니다. Computes the average of a sequence of nullable Doublevalues that are obtained by invoking a transform function on each element of the input sequence.(Enumerable에서 정의됨) | |
Average<T>(Func<T, Nullable<Int32>>) | 오버로드되었습니다. Computes the average of a sequence of nullable Int32values that are obtained by invoking a transform function on each element of the input sequence.(Enumerable에서 정의됨) | |
Average<T>(Func<T, Nullable<Int64>>) | 오버로드되었습니다. Computes the average of a sequence of nullable Int64values that are obtained by invoking a transform function on each element of the input sequence.(Enumerable에서 정의됨) | |
Average<T>(Func<T, Nullable<Single>>) | 오버로드되었습니다. Computes the average of a sequence of nullable Singlevalues that are obtained by invoking a transform function on each element of the input sequence.(Enumerable에서 정의됨) | |
Average<T>(Func<T, Single>) | 오버로드되었습니다. Computes the average of a sequence of Single values that are obtained by invoking a transform function on each element of the input sequence.(Enumerable에서 정의됨) | |
Cast<TResult>() | Casts the elements of an IEnumerable to the specified type.(Enumerable에서 정의됨) | |
Concat<T>(IEnumerable<T>) | Concatenates two sequences.(Enumerable에서 정의됨) | |
Contains<T>(T) | 오버로드되었습니다. Determines whether a sequence contains a specified element by using the default equality comparer.(Enumerable에서 정의됨) | |
Contains<T>(T, IEqualityComparer<T>) | 오버로드되었습니다. Determines whether a sequence contains a specified element by using a specified IEqualityComparer<T>.(Enumerable에서 정의됨) | |
Count<T>() | 오버로드되었습니다. Returns the number of elements in a sequence.(Enumerable에서 정의됨) | |
Count<T>(Func<T, Boolean>) | 오버로드되었습니다. Returns a number that represents how many elements in the specified sequence satisfy a condition.(Enumerable에서 정의됨) | |
DefaultIfEmpty<T>() | 오버로드되었습니다. Returns the elements of the specified sequence or the type parameter's default value in a singleton collection if the sequence is empty.(Enumerable에서 정의됨) | |
DefaultIfEmpty<T>(T) | 오버로드되었습니다. Returns the elements of the specified sequence or the specified value in a singleton collection if the sequence is empty.(Enumerable에서 정의됨) | |
Distinct<T>() | 오버로드되었습니다. Returns distinct elements from a sequence by using the default equality comparer to compare values.(Enumerable에서 정의됨) | |
Distinct<T>(IEqualityComparer<T>) | 오버로드되었습니다. Returns distinct elements from a sequence by using a specified IEqualityComparer<T> to compare values.(Enumerable에서 정의됨) | |
ElementAt<T>(Int32) | Returns the element at a specified index in a sequence.(Enumerable에서 정의됨) | |
ElementAtOrDefault<T>(Int32) | Returns the element at a specified index in a sequence or a default value if the index is out of range.(Enumerable에서 정의됨) | |
Except<T>(IEnumerable<T>) | 오버로드되었습니다. Produces the set difference of two sequences by using the default equality comparer to compare values.(Enumerable에서 정의됨) | |
Except<T>(IEnumerable<T>, IEqualityComparer<T>) | 오버로드되었습니다. Produces the set difference of two sequences by using the specified IEqualityComparer<T> to compare values.(Enumerable에서 정의됨) | |
First<T>() | 오버로드되었습니다. Returns the first element of a sequence.(Enumerable에서 정의됨) | |
First<T>(Func<T, Boolean>) | 오버로드되었습니다. Returns the first element in a sequence that satisfies a specified condition.(Enumerable에서 정의됨) | |
FirstOrDefault<T>() | 오버로드되었습니다. Returns the first element of a sequence, or a default value if the sequence contains no elements.(Enumerable에서 정의됨) | |
FirstOrDefault<T>(Func<T, Boolean>) | 오버로드되었습니다. Returns the first element of the sequence that satisfies a condition or a default value if no such element is found.(Enumerable에서 정의됨) | |
GroupBy<T, TKey>(Func<T, TKey>) | 오버로드되었습니다. Groups the elements of a sequence according to a specified key selector function.(Enumerable에서 정의됨) | |
GroupBy<T, TKey>(Func<T, TKey>, IEqualityComparer<TKey>) | 오버로드되었습니다. Groups the elements of a sequence according to a specified key selector function and compares the keys by using a specified comparer.(Enumerable에서 정의됨) | |
GroupBy<T, TKey, TElement>(Func<T, TKey>, Func<T, TElement>) | 오버로드되었습니다. Groups the elements of a sequence according to a specified key selector function and projects the elements for each group by using a specified function.(Enumerable에서 정의됨) | |
GroupBy<T, TKey, TElement>(Func<T, TKey>, Func<T, TElement>, IEqualityComparer<TKey>) | 오버로드되었습니다. Groups the elements of a sequence according to a key selector function. The keys are compared by using a comparer and each group's elements are projected by using a specified function.(Enumerable에서 정의됨) | |
GroupBy<T, TKey, TResult>(Func<T, TKey>, Func<TKey, IEnumerable<T>, TResult>) | 오버로드되었습니다. Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key.(Enumerable에서 정의됨) | |
GroupBy<T, TKey, TResult>(Func<T, TKey>, Func<TKey, IEnumerable<T>, TResult>, IEqualityComparer<TKey>) | 오버로드되었습니다. Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. The keys are compared by using a specified comparer.(Enumerable에서 정의됨) | |
GroupBy<T, TKey, TElement, TResult>(Func<T, TKey>, Func<T, TElement>, Func<TKey, IEnumerable<TElement>, TResult>) | 오버로드되었습니다. Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. The elements of each group are projected by using a specified function.(Enumerable에서 정의됨) | |
GroupBy<T, TKey, TElement, TResult>(Func<T, TKey>, Func<T, TElement>, Func<TKey, IEnumerable<TElement>, TResult>, IEqualityComparer<TKey>) | 오버로드되었습니다. Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. Key values are compared by using a specified comparer, and the elements of each group are projected by using a specified function.(Enumerable에서 정의됨) | |
GroupJoin<T, TInner, TKey, TResult>(IEnumerable<TInner>, Func<T, TKey>, Func<TInner, TKey>, Func<T, IEnumerable<TInner>, TResult>) | 오버로드되었습니다. Correlates the elements of two sequences based on equality of keys and groups the results. The default equality comparer is used to compare keys.(Enumerable에서 정의됨) | |
GroupJoin<T, TInner, TKey, TResult>(IEnumerable<TInner>, Func<T, TKey>, Func<TInner, TKey>, Func<T, IEnumerable<TInner>, TResult>, IEqualityComparer<TKey>) | 오버로드되었습니다. Correlates the elements of two sequences based on key equality and groups the results. A specified IEqualityComparer<T> is used to compare keys.(Enumerable에서 정의됨) | |
Intersect<T>(IEnumerable<T>) | 오버로드되었습니다. Produces the set intersection of two sequences by using the default equality comparer to compare values.(Enumerable에서 정의됨) | |
Intersect<T>(IEnumerable<T>, IEqualityComparer<T>) | 오버로드되었습니다. Produces the set intersection of two sequences by using the specified IEqualityComparer<T> to compare values.(Enumerable에서 정의됨) | |
Join<T, TInner, TKey, TResult>(IEnumerable<TInner>, Func<T, TKey>, Func<TInner, TKey>, Func<T, TInner, TResult>) | 오버로드되었습니다. Correlates the elements of two sequences based on matching keys. The default equality comparer is used to compare keys.(Enumerable에서 정의됨) | |
Join<T, TInner, TKey, TResult>(IEnumerable<TInner>, Func<T, TKey>, Func<TInner, TKey>, Func<T, TInner, TResult>, IEqualityComparer<TKey>) | 오버로드되었습니다. Correlates the elements of two sequences based on matching keys. A specified IEqualityComparer<T> is used to compare keys.(Enumerable에서 정의됨) | |
Last<T>() | 오버로드되었습니다. Returns the last element of a sequence.(Enumerable에서 정의됨) | |
Last<T>(Func<T, Boolean>) | 오버로드되었습니다. Returns the last element of a sequence that satisfies a specified condition.(Enumerable에서 정의됨) | |
LastOrDefault<T>() | 오버로드되었습니다. Returns the last element of a sequence, or a default value if the sequence contains no elements.(Enumerable에서 정의됨) | |
LastOrDefault<T>(Func<T, Boolean>) | 오버로드되었습니다. Returns the last element of a sequence that satisfies a condition or a default value if no such element is found.(Enumerable에서 정의됨) | |
LongCount<T>() | 오버로드되었습니다. Returns an Int64 that represents the total number of elements in a sequence.(Enumerable에서 정의됨) | |
LongCount<T>(Func<T, Boolean>) | 오버로드되었습니다. Returns an Int64 that represents how many elements in a sequence satisfy a condition.(Enumerable에서 정의됨) | |
Max<T>() | 오버로드되었습니다. Returns the maximum value in a generic sequence.(Enumerable에서 정의됨) | |
Max<T>(Func<T, Decimal>) | 오버로드되었습니다. Invokes a transform function on each element of a sequence and returns the maximum Decimal value.(Enumerable에서 정의됨) | |
Max<T>(Func<T, Double>) | 오버로드되었습니다. Invokes a transform function on each element of a sequence and returns the maximum Double value.(Enumerable에서 정의됨) | |
Max<T>(Func<T, Int32>) | 오버로드되었습니다. Invokes a transform function on each element of a sequence and returns the maximum Int32 value.(Enumerable에서 정의됨) | |
Max<T>(Func<T, Int64>) | 오버로드되었습니다. Invokes a transform function on each element of a sequence and returns the maximum Int64 value.(Enumerable에서 정의됨) | |
Max<T>(Func<T, Nullable<Decimal>>) | 오버로드되었습니다. Invokes a transform function on each element of a sequence and returns the maximum nullable Decimal value.(Enumerable에서 정의됨) | |
Max<T>(Func<T, Nullable<Double>>) | 오버로드되었습니다. Invokes a transform function on each element of a sequence and returns the maximum nullable Double value.(Enumerable에서 정의됨) | |
Max<T>(Func<T, Nullable<Int32>>) | 오버로드되었습니다. Invokes a transform function on each element of a sequence and returns the maximum nullable Int32 value.(Enumerable에서 정의됨) | |
Max<T>(Func<T, Nullable<Int64>>) | 오버로드되었습니다. Invokes a transform function on each element of a sequence and returns the maximum nullable Int64 value.(Enumerable에서 정의됨) | |
Max<T>(Func<T, Nullable<Single>>) | 오버로드되었습니다. Invokes a transform function on each element of a sequence and returns the maximum nullable Single value.(Enumerable에서 정의됨) | |
Max<T>(Func<T, Single>) | 오버로드되었습니다. Invokes a transform function on each element of a sequence and returns the maximum Single value.(Enumerable에서 정의됨) | |
Max<T, TResult>(Func<T, TResult>) | 오버로드되었습니다. Invokes a transform function on each element of a generic sequence and returns the maximum resulting value.(Enumerable에서 정의됨) | |
Min<T>() | 오버로드되었습니다. Returns the minimum value in a generic sequence.(Enumerable에서 정의됨) | |
Min<T>(Func<T, Decimal>) | 오버로드되었습니다. Invokes a transform function on each element of a sequence and returns the minimum Decimal value.(Enumerable에서 정의됨) | |
Min<T>(Func<T, Double>) | 오버로드되었습니다. Invokes a transform function on each element of a sequence and returns the minimum Double value.(Enumerable에서 정의됨) | |
Min<T>(Func<T, Int32>) | 오버로드되었습니다. Invokes a transform function on each element of a sequence and returns the minimum Int32 value.(Enumerable에서 정의됨) | |
Min<T>(Func<T, Int64>) | 오버로드되었습니다. Invokes a transform function on each element of a sequence and returns the minimum Int64 value.(Enumerable에서 정의됨) | |
Min<T>(Func<T, Nullable<Decimal>>) | 오버로드되었습니다. Invokes a transform function on each element of a sequence and returns the minimum nullable Decimal value.(Enumerable에서 정의됨) | |
Min<T>(Func<T, Nullable<Double>>) | 오버로드되었습니다. Invokes a transform function on each element of a sequence and returns the minimum nullable Double value.(Enumerable에서 정의됨) | |
Min<T>(Func<T, Nullable<Int32>>) | 오버로드되었습니다. Invokes a transform function on each element of a sequence and returns the minimum nullable Int32 value.(Enumerable에서 정의됨) | |
Min<T>(Func<T, Nullable<Int64>>) | 오버로드되었습니다. Invokes a transform function on each element of a sequence and returns the minimum nullable Int64 value.(Enumerable에서 정의됨) | |
Min<T>(Func<T, Nullable<Single>>) | 오버로드되었습니다. Invokes a transform function on each element of a sequence and returns the minimum nullable Single value.(Enumerable에서 정의됨) | |
Min<T>(Func<T, Single>) | 오버로드되었습니다. Invokes a transform function on each element of a sequence and returns the minimum Single value.(Enumerable에서 정의됨) | |
Min<T, TResult>(Func<T, TResult>) | 오버로드되었습니다. Invokes a transform function on each element of a generic sequence and returns the minimum resulting value.(Enumerable에서 정의됨) | |
OfType<TResult>() | Filters the elements of an IEnumerable based on a specified type.(Enumerable에서 정의됨) | |
OrderBy<T, TKey>(Func<T, TKey>) | 오버로드되었습니다. Sorts the elements of a sequence in ascending order according to a key.(Enumerable에서 정의됨) | |
OrderBy<T, TKey>(Func<T, TKey>, IComparer<TKey>) | 오버로드되었습니다. Sorts the elements of a sequence in ascending order by using a specified comparer.(Enumerable에서 정의됨) | |
OrderByDescending<T, TKey>(Func<T, TKey>) | 오버로드되었습니다. Sorts the elements of a sequence in descending order according to a key.(Enumerable에서 정의됨) | |
OrderByDescending<T, TKey>(Func<T, TKey>, IComparer<TKey>) | 오버로드되었습니다. Sorts the elements of a sequence in descending order by using a specified comparer.(Enumerable에서 정의됨) | |
Reverse<T>() | Inverts the order of the elements in a sequence.(Enumerable에서 정의됨) | |
Select<T, TResult>(Func<T, TResult>) | 오버로드되었습니다. Projects each element of a sequence into a new form.(Enumerable에서 정의됨) | |
Select<T, TResult>(Func<T, Int32, TResult>) | 오버로드되었습니다. Projects each element of a sequence into a new form by incorporating the element's index.(Enumerable에서 정의됨) | |
SelectMany<T, TResult>(Func<T, IEnumerable<TResult>>) | 오버로드되었습니다. Projects each element of a sequence to an IEnumerable<T> and flattens the resulting sequences into one sequence.(Enumerable에서 정의됨) | |
SelectMany<T, TResult>(Func<T, Int32, IEnumerable<TResult>>) | 오버로드되었습니다. Projects each element of a sequence to an IEnumerable<T>, and flattens the resulting sequences into one sequence. The index of each source element is used in the projected form of that element.(Enumerable에서 정의됨) | |
SelectMany<T, TCollection, TResult>(Func<T, IEnumerable<TCollection>>, Func<T, TCollection, TResult>) | 오버로드되었습니다. Projects each element of a sequence to an IEnumerable<T>, flattens the resulting sequences into one sequence, and invokes a result selector function on each element therein.(Enumerable에서 정의됨) | |
SelectMany<T, TCollection, TResult>(Func<T, Int32, IEnumerable<TCollection>>, Func<T, TCollection, TResult>) | 오버로드되었습니다. Projects each element of a sequence to an IEnumerable<T>, flattens the resulting sequences into one sequence, and invokes a result selector function on each element therein. The index of each source element is used in the intermediate projected form of that element.(Enumerable에서 정의됨) | |
SequenceEqual<T>(IEnumerable<T>) | 오버로드되었습니다. Determines whether two sequences are equal by comparing the elements by using the default equality comparer for their type.(Enumerable에서 정의됨) | |
SequenceEqual<T>(IEnumerable<T>, IEqualityComparer<T>) | 오버로드되었습니다. Determines whether two sequences are equal by comparing their elements by using a specified IEqualityComparer<T>.(Enumerable에서 정의됨) | |
Single<T>() | 오버로드되었습니다. Returns the only element of a sequence, and throws an exception if there is not exactly one element in the sequence.(Enumerable에서 정의됨) | |
Single<T>(Func<T, Boolean>) | 오버로드되었습니다. Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists.(Enumerable에서 정의됨) | |
SingleOrDefault<T>() | 오버로드되었습니다. Returns the only element of a sequence, or a default value if the sequence is empty; this method throws an exception if there is more than one element in the sequence.(Enumerable에서 정의됨) | |
SingleOrDefault<T>(Func<T, Boolean>) | 오버로드되었습니다. Returns the only element of a sequence that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition.(Enumerable에서 정의됨) | |
Skip<T>(Int32) | Bypasses a specified number of elements in a sequence and then returns the remaining elements.(Enumerable에서 정의됨) | |
SkipWhile<T>(Func<T, Boolean>) | 오버로드되었습니다. Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements.(Enumerable에서 정의됨) | |
SkipWhile<T>(Func<T, Int32, Boolean>) | 오버로드되었습니다. Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements. The element's index is used in the logic of the predicate function.(Enumerable에서 정의됨) | |
Sum<T>(Func<T, Decimal>) | 오버로드되었습니다. Computes the sum of the sequence of Decimal values that are obtained by invoking a transform function on each element of the input sequence.(Enumerable에서 정의됨) | |
Sum<T>(Func<T, Double>) | 오버로드되었습니다. Computes the sum of the sequence of Double values that are obtained by invoking a transform function on each element of the input sequence.(Enumerable에서 정의됨) | |
Sum<T>(Func<T, Int32>) | 오버로드되었습니다. Computes the sum of the sequence of Int32 values that are obtained by invoking a transform function on each element of the input sequence.(Enumerable에서 정의됨) | |
Sum<T>(Func<T, Int64>) | 오버로드되었습니다. Computes the sum of the sequence of Int64 values that are obtained by invoking a transform function on each element of the input sequence.(Enumerable에서 정의됨) | |
Sum<T>(Func<T, Nullable<Decimal>>) | 오버로드되었습니다. Computes the sum of the sequence of nullable Decimalvalues that are obtained by invoking a transform function on each element of the input sequence.(Enumerable에서 정의됨) | |
Sum<T>(Func<T, Nullable<Double>>) | 오버로드되었습니다. Computes the sum of the sequence of nullable Doublevalues that are obtained by invoking a transform function on each element of the input sequence.(Enumerable에서 정의됨) | |
Sum<T>(Func<T, Nullable<Int32>>) | 오버로드되었습니다. Computes the sum of the sequence of nullable Int32values that are obtained by invoking a transform function on each element of the input sequence.(Enumerable에서 정의됨) | |
Sum<T>(Func<T, Nullable<Int64>>) | 오버로드되었습니다. Computes the sum of the sequence of nullable Int64values that are obtained by invoking a transform function on each element of the input sequence.(Enumerable에서 정의됨) | |
Sum<T>(Func<T, Nullable<Single>>) | 오버로드되었습니다. Computes the sum of the sequence of nullable Singlevalues that are obtained by invoking a transform function on each element of the input sequence.(Enumerable에서 정의됨) | |
Sum<T>(Func<T, Single>) | 오버로드되었습니다. Computes the sum of the sequence of Single values that are obtained by invoking a transform function on each element of the input sequence.(Enumerable에서 정의됨) | |
Take<T>(Int32) | Returns a specified number of contiguous elements from the start of a sequence.(Enumerable에서 정의됨) | |
TakeWhile<T>(Func<T, Boolean>) | 오버로드되었습니다. Returns elements from a sequence as long as a specified condition is true.(Enumerable에서 정의됨) | |
TakeWhile<T>(Func<T, Int32, Boolean>) | 오버로드되었습니다. Returns elements from a sequence as long as a specified condition is true. The element's index is used in the logic of the predicate function.(Enumerable에서 정의됨) | |
ToArray<T>() | Creates an array from a IEnumerable<T>.(Enumerable에서 정의됨) | |
ToDictionary<T, TKey>(Func<T, TKey>) | 오버로드되었습니다. Creates a Dictionary<TKey, TValue> from an IEnumerable<T> according to a specified key selector function.(Enumerable에서 정의됨) | |
ToDictionary<T, TKey>(Func<T, TKey>, IEqualityComparer<TKey>) | 오버로드되었습니다. Creates a Dictionary<TKey, TValue> from an IEnumerable<T> according to a specified key selector function and key comparer.(Enumerable에서 정의됨) | |
ToDictionary<T, TKey, TElement>(Func<T, TKey>, Func<T, TElement>) | 오버로드되었습니다. Creates a Dictionary<TKey, TValue> from an IEnumerable<T> according to specified key selector and element selector functions.(Enumerable에서 정의됨) | |
ToDictionary<T, TKey, TElement>(Func<T, TKey>, Func<T, TElement>, IEqualityComparer<TKey>) | 오버로드되었습니다. Creates a Dictionary<TKey, TValue> from an IEnumerable<T> according to a specified key selector function, a comparer, and an element selector function.(Enumerable에서 정의됨) | |
ToList<T>() | Creates a List<T> from an IEnumerable<T>.(Enumerable에서 정의됨) | |
ToLookup<T, TKey>(Func<T, TKey>) | 오버로드되었습니다. Creates a Lookup<TKey, TElement> from an IEnumerable<T> according to a specified key selector function.(Enumerable에서 정의됨) | |
ToLookup<T, TKey>(Func<T, TKey>, IEqualityComparer<TKey>) | 오버로드되었습니다. Creates a Lookup<TKey, TElement> from an IEnumerable<T> according to a specified key selector function and key comparer.(Enumerable에서 정의됨) | |
ToLookup<T, TKey, TElement>(Func<T, TKey>, Func<T, TElement>) | 오버로드되었습니다. Creates a Lookup<TKey, TElement> from an IEnumerable<T> according to specified key selector and element selector functions.(Enumerable에서 정의됨) | |
ToLookup<T, TKey, TElement>(Func<T, TKey>, Func<T, TElement>, IEqualityComparer<TKey>) | 오버로드되었습니다. Creates a Lookup<TKey, TElement> from an IEnumerable<T> according to a specified key selector function, a comparer and an element selector function.(Enumerable에서 정의됨) | |
Union<T>(IEnumerable<T>) | 오버로드되었습니다. Produces the set union of two sequences by using the default equality comparer.(Enumerable에서 정의됨) | |
Union<T>(IEnumerable<T>, IEqualityComparer<T>) | 오버로드되었습니다. Produces the set union of two sequences by using a specified IEqualityComparer<T>.(Enumerable에서 정의됨) | |
Where<T>(Func<T, Boolean>) | 오버로드되었습니다. Filters a sequence of values based on a predicate.(Enumerable에서 정의됨) | |
Where<T>(Func<T, Int32, Boolean>) | 오버로드되었습니다. Filters a sequence of values based on a predicate. Each element's index is used in the logic of the predicate function.(Enumerable에서 정의됨) | |
Zip<T, TSecond, TResult>(IEnumerable<TSecond>, Func<T, TSecond, TResult>) | Applies a specified function to the corresponding elements of two sequences, producing a sequence of the results.(Enumerable에서 정의됨) |
In many cases the data that you work with is a collection of objects. For example, a common scenario in data binding is to use an ItemsControl such as a ListBox, ListView, or TreeView to display a collection of records.
You can enumerate over any collection that implements the IEnumerable interface. However, to set up dynamic bindings so that insertions or deletions in the collection update the UI automatically, the collection must implement the INotifyCollectionChanged interface. This interface exposes the CollectionChanged event, an event that should be raised whenever the underlying collection changes.
WPF provides the ObservableCollection<T> class, which is a built-in implementation of a data collection that implements the INotifyCollectionChanged interface.
Before implementing your own collection, consider using ObservableCollection<T> or one of the existing collection classes, such as List<T>, Collection<T>, and BindingList<T>, among many others. If you have an advanced scenario and want to implement your own collection, consider using IList, which provides a non-generic collection of objects that can be individually accessed by index. Implementing IList provides the best performance with the data binding engine.
참고 |
---|
To fully support transferring data values from binding source objects to binding targets, each object in your collection that supports bindable properties must implement an appropriate property changed notification mechanism such as the INotifyPropertyChangedinterface. |
For more information, see "Binding to Collections" in Data Binding Overview.
ObservableCollection<T> can be used as a XAML object element in Windows Presentation Foundation (WPF), in versions 3.0 and 3.5.However, the usage has substantial limitations.
ObservableCollection<T> must be the root element, because the that must be used to specify the constrained type of the generic ObservableCollection<T> is only supported on the object element for the root element.
You must declare an (which entails that the build action for this XAML file must be Page or some other build action that compiles the XAML).
ObservableCollection<T> is in a namespace and assembly that are not initially mapped to the default XML namespace. You must map a prefix for the namespace and assembly, and then use that prefix on the object element tag for ObservableCollection<T>.
A more straightforward way to use ObservableCollection<T> capabilities from XAML in an application is to declare your own non-generic custom collection class that derives from ObservableCollection<T>, and constrains it to a specific type. Then map the assembly that contains this class, and reference it as an object element in your XAML.
INotifyPropertyChanged Interface
https://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged(v=vs.110).aspx
Notifies clients that a property value has changed.
Assembly: System (in System.dll)
Events
Name | Description | |
---|---|---|
PropertyChanged | Occurs when a property value changes. |
Remarks
The INotifyPropertyChanged interface is used to notify clients, typically binding clients, that a property value has changed.
For example, consider a Person object with a property called FirstName. To provide generic property-change notification, the Person type implements the INotifyPropertyChanged interface and raises a PropertyChanged event when FirstName is changed.
For change notification to occur in a binding between a bound client and a data source, your bound type should either:
Implement the INotifyPropertyChanged interface (preferred).
Provide a change event for each property of the bound type.
Do not do both.
Examples
The following code example demonstrates the how to implement the INotifyPropertyChanged interface. When you run this example, you will notice the bound DataGridView control reflects the change in the data source without requiring the binding to be reset.
If you use the CallerMemberName attribute, calls to the NotifyPropertyChanged method don't have to specify the property name as a string argument. For more information, see Caller Information (C# and Visual Basic).
Replace the code in your Form1 with the following code and then change the namespace to the name of your project. As an alternative, you can name your project with the namespace name below when you create it.
using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Runtime.CompilerServices; using System.Windows.Forms; // Either change the following namespace to the name of your project, // or name your project with the following name when you create it. namespace TestNotifyPropertyChangedCS { // This form demonstrates using a BindingSource to bind // a list to a DataGridView control. The list does not // raise change notifications. However the DemoCustomer type // in the list does. public partial class Form1 : Form { // This button causes the value of a list element to be changed. private Button changeItemBtn = new Button(); // This DataGridView control displays the contents of the list. private DataGridView customersDataGridView = new DataGridView(); // This BindingSource binds the list to the DataGridView control. private BindingSource customersBindingSource = new BindingSource(); public Form1() { InitializeComponent(); // Set up the "Change Item" button. this.changeItemBtn.Text = "Change Item"; this.changeItemBtn.Dock = DockStyle.Bottom; this.changeItemBtn.Click += new EventHandler(changeItemBtn_Click); this.Controls.Add(this.changeItemBtn); // Set up the DataGridView. customersDataGridView.Dock = DockStyle.Top; this.Controls.Add(customersDataGridView); this.Size = new Size(400, 200); } private void Form1_Load(object sender, EventArgs e) { // Create and populate the list of DemoCustomer objects // which will supply data to the DataGridView. BindingList<DemoCustomer> customerList = new BindingList<DemoCustomer>(); customerList.Add(DemoCustomer.CreateNewCustomer()); customerList.Add(DemoCustomer.CreateNewCustomer()); customerList.Add(DemoCustomer.CreateNewCustomer()); // Bind the list to the BindingSource. this.customersBindingSource.DataSource = customerList; // Attach the BindingSource to the DataGridView. this.customersDataGridView.DataSource = this.customersBindingSource; } // Change the value of the CompanyName property for the first // item in the list when the "Change Item" button is clicked. void changeItemBtn_Click(object sender, EventArgs e) { // Get a reference to the list from the BindingSource. BindingList<DemoCustomer> customerList = this.customersBindingSource.DataSource as BindingList<DemoCustomer>; // Change the value of the CompanyName property for the // first item in the list. customerList[0].CustomerName = "Tailspin Toys"; customerList[0].PhoneNumber = "(708)555-0150"; } } // This is a simple customer class that // implements the IPropertyChange interface. public class DemoCustomer : INotifyPropertyChanged { // These fields hold the values for the public properties. private Guid idValue = Guid.NewGuid(); private string customerNameValue = String.Empty; private string phoneNumberValue = String.Empty; public event PropertyChangedEventHandler PropertyChanged; // This method is called by the Set accessor of each property. // The CallerMemberName attribute that is applied to the optional propertyName // parameter causes the property name of the caller to be substituted as an argument. private void NotifyPropertyChanged([CallerMemberName] String propertyName = "") { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } // The constructor is private to enforce the factory pattern. private DemoCustomer() { customerNameValue = "Customer"; phoneNumberValue = "(312)555-0100"; } // This is the public factory method. public static DemoCustomer CreateNewCustomer() { return new DemoCustomer(); } // This property represents an ID, suitable // for use as a primary key in a database. public Guid ID { get { return this.idValue; } } public string CustomerName { get { return this.customerNameValue; } set { if (value != this.customerNameValue) { this.customerNameValue = value; NotifyPropertyChanged(); } } } public string PhoneNumber { get { return this.phoneNumberValue; } set { if (value != this.phoneNumberValue) { this.phoneNumberValue = value; NotifyPropertyChanged(); } } } } }
Caller Information
https://msdn.microsoft.com/ko-kr/library/hh534540(v=vs.110).aspx
By using Caller Info attributes, you can obtain information about the caller to a method. You can obtain file path of the source code, the line number in the source code, and the member name of the caller. This information is helpful for tracing, debugging, and creating diagnostic tools.
To obtain this information, you use attributes that are applied to optional parameters, each of which has a default value. The following table lists the Caller Info attributes that are defined in the System.Runtime.CompilerServices namespace:
Attribute | Description | Type |
Full path of the source file that contains the caller. This is the file path at compile time. | String | |
Line number in the source file at which the method is called. | Integer | |
Method or property name of the caller. See Member Names later in this topic. | String |
The following example shows how to use Caller Info attributes. On each call to the TraceMessage method, the caller information is substituted as arguments to the optional parameters.
// using System.Runtime.CompilerServices // using System.Diagnostics; public void DoProcessing() { TraceMessage("Something happened."); } public void TraceMessage(string message, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0) { Trace.WriteLine("message: " + message); Trace.WriteLine("member name: " + memberName); Trace.WriteLine("source file path: " + sourceFilePath); Trace.WriteLine("source line number: " + sourceLineNumber); } // Sample Output: // message: Something happened. // member name: DoProcessing // source file path: c:\Users\username\Documents\Visual Studio 2012\Projects\CallerInfoCS\CallerInfoCS\Form1.cs // source line number: 31
You must specify an explicit default value for each optional parameter. You can't apply Caller Info attributes to parameters that aren't specified as optional.
The Caller Info attributes don't make a parameter optional. Instead, they affect the default value that's passed in when the argument is omitted.
Caller Info values are emitted as literals into the Intermediate Language (IL) at compile time. Unlike the results of the StackTrace property for exceptions, the results aren't affected by obfuscation.
Member Names
You can use the CallerMemberName attribute to avoid specifying the member name as a String argument to the called method. By using this technique, you avoid the problem that Rename Refactoring doesn't change the String values. This benefit is especially useful for the following tasks:
Using tracing and diagnostic routines.
Implementing the INotifyPropertyChanged interface when binding data. This interface allows the property of an object to notify a bound control that the property has changed, so that the control can display the updated information. Without the CallerMemberName attribute, you must specify the property name as a literal.
The following chart shows the member names that are returned when you use the CallerMemberName attribute.
Calls occurs within | Member name result |
---|---|
Method, property, or event | The name of the method, property, or event from which the call originated. |
Constructor | The string ".ctor" |
Static constructor | The string ".cctor" |
Destructor | The string "Finalize" |
User-defined operators or conversions | The generated name for the member, for example, "op_Addition". |
Attribute constructor | The name of the member to which the attribute is applied. If the attribute is any element within a member (such as a parameter, a return value, or a generic type parameter), this result is the name of the member that's associated with that element. |
No containing member (for example, assembly-level or attributes that are applied to types) | The default value of the optional parameter. |
'프로그래밍 > WPF' 카테고리의 다른 글
WPF 고급 - 끌어서 놓기 (Drag and Drop) (0) | 2016.10.21 |
---|---|
WPF 고급 - 입력 (Input) (0) | 2016.10.15 |
WPF 고급 - 아키텍처, XAML (0) | 2016.09.23 |
WPF - Application Development (1) | 2016.09.08 |
Data Binding (WPF) (0) | 2016.09.04 |