Namespace: Semata.DataStore.ObjectModel.Views
Abstract base class for all ItemObjectViews.
Many of the ItemObjectView properties will be the same as that of the ItemObject. However, the PropertyChanged events of the ItemObject cannot just be forwarded as some of the ItemObjectView properties may need to perform processing before the event is passed on. Instead PropertyChanged and PropertyWritten events from the ItemObject cause a PropertySourceChanged to be raised. The properties ubscribe to this event, perform the necessary processin , and then raise the PropertyChanged event.
generic <typename I> where I : ItemObject public ref class ItemObjectView abstract : public ItemObjectView , IEditableData , IEditableObject , INotifyPropertySourceChanged , IValidatableObject , IEquatable<ItemObjectView<I^>>
Inherits: ItemObjectView
Implements: IEditableData , IEditableObject , INotifyPropertySourceChanged , MISSING PAGE IValidatableObject , IEquatable<ItemObjectView<I>>
Constructors
Name | Description |
ItemObjectView() |
Default constructor, mainly used controls, such as DataGrid, that require it for their new object logic |
ItemObjectView(I^, bool, bool) |
Creates new ItemObjectView from an ItemObject |
ItemObjectView(ItemObjectView<I>^, bool, bool) |
Creates new ItemObjectView from another ItemObjectVew |
Events
Name | Description |
ErrorsChanged |
Occurs when the erros on the viewed ItemObject changes |
PropertyChanged |
Occurs when a property value changes. |
PropertySourceChanged |
Occurs whenever the source of the view raises PropertyChanged and UsesPropertyChange is true, or PropertyWritten is raised |
StateChanged |
Occurs when the value changes of any property. |
Properties
Name | Description |
DataName |
The name of the underlying Item (IEditableData) |
HasErrors |
Gets a value that indicates whether the entity has validation errors. |
IsChanged |
Are there any changes to properties that have not been written to the DataStore? |
IsDeleted |
Has this ItemObject been deleted? |
IsInitialized |
Has the been initialized. In other words does the property ItemObject not null |
IsNew |
Is the ItemObject new? In other words, has been written to the DataStore. |
ItemObject |
Returns the viewed ItemObject |
UsesPropertyChanged |
True if the ItemObjectView subscribes to the PropertyChanged event of the ItemObject |
WriteOnEndEdit |
True if Write will be called on EndEdit |
operator |
Returns false if both views are null, or are views of the same ItemObject |
Methods
Name | Description |
BeginEdit() |
Starts editing |
CanDelete() |
Determines if the viewed ItemObject can be deleted |
CancelEdit() |
Cancels the edits on the ItemObject |
ClearErrors() |
Clear all errors on the ItemObject. |
ClearErrors(String^) |
Clear errors for specified property name. |
Delete() |
Delete Item from DataStore |
Delete(bool) |
Delete Item from DataStore and throw exception if errors occur <param name="throwException">if true errors will cause exception to be thrown.</param> |
EndEdit() |
If WriteOnEdit is true calls Write, otherwise call ItemObject.Validate() |
Equals(ItemObjectView<I>^) |
Returns true if other is a view of the same ItemObject |
Equals(Object^) |
Returns true if obj is a view of the same ItemObject |
GetDeleteErrors() |
Get all deletion errors on the ItemObject. |
GetErrors() |
Get all errors on the ItemObject. |
GetErrors(String^) |
Gets the validation errors for a specified property or for the entire object. |
GetHashCode() |
Returns the HasCode of the viewed ItemObject |
Initialize(ItemObjectView<I>^) |
Initializes the view from a view based on the same ItemObject |
NotifyErrorsChanged(DataErrorsChangedEventArgs^) |
Raises event ErrorsChanged |
NotifyPropertyChanged(PropertyChangedEventArgs^) |
Raises event PropertyChanged |
NotifyPropertySourceChanged(PropertyChangedEventArgs^) |
Raises event PropertySourceChanged |
NotifyStateChanged() |
Raises event StateChanged |
Validate() |
Validates the viewed ItemObject |
Write() |
Writes the viewed ItemObject |
Write(bool) |
Writes the viewed ItemObject and throw exception if errors occur <param name="throwException">if true errors will cause exception to be thrown.</param> |