Wraps and creates a CSLA .NET-style object that you can use as a binding source. More...
Public Member Functions | |
CslaDataProvider () | |
Creates an instance of the object. More... | |
void | Rebind () |
Triggers WPF data binding to rebind to the data object. More... | |
void | Refresh< T > (Func< T > factory) |
Refresh the ObjectInstance by calling the supplied factory. More... | |
async void | Refresh< T > (Func< Task< T > > factory) |
Refresh the ObjectInstance by calling the supplied factory. More... | |
void | Cancel () |
Cancels changes to the business object, returning it to its previous state. More... | |
void | Save () |
Accepts changes to the business object, and commits them by calling the object's Save() method. More... | |
object | AddNew () |
Adds a new item to the object if the object implements IBindingList and AllowNew is true. More... | |
void | RemoveItem (object sender, ExecuteEventArgs e) |
Removes an item from the list if the object implements IBindingList and AllowRemove is true. More... | |
Protected Member Functions | |
virtual void | OnSaved (object newObject, Exception error, object userState) |
Raise the Saved event when the object has been saved. More... | |
override void | BeginInit () |
Indicates that the control is about to initialize. More... | |
override void | EndInit () |
Indicates that the control has initialized. More... | |
override void | BeginQuery () |
Overridden. More... | |
Properties | |
CslaDataProviderCommandManager | CommandManager [get] |
Gets an object that can be used to execute Save and Undo commands on this CslaDataProvider through XAML command bindings. More... | |
Type | ObjectType [getset] |
Gets or sets the type of object to create an instance of. More... | |
bool | ManageObjectLifetime [getset] |
Gets or sets a value indicating whether the data control should manage the lifetime of the business object, including using n-level undo. More... | |
object | DataChangedHandler [getset] |
Gets or sets a reference to an object that will handle the DataChanged event raised by this data provider. More... | |
string | FactoryMethod [getset] |
Gets or sets the name of the static (Shared in Visual Basic) factory method that should be called to create the object instance. More... | |
IList | FactoryParameters [get] |
Get the list of parameters to pass to the factory method. More... | |
bool | IsAsynchronous [getset] |
Gets or sets a value that indicates whether to perform object creation in a worker thread or in the active context. More... | |
object | ObjectInstance [getset] |
Gets or sets a reference to the data object. More... | |
bool | IsBusy [getprotected set] |
Gets a value indicating if this object is busy. More... | |
Events | |
EventHandler< Csla.Core.SavedEventArgs > | Saved |
Event raised when the object has been saved. More... | |
Wraps and creates a CSLA .NET-style object that you can use as a binding source.
Definition at line 26 of file CslaDataProvider.cs.
Csla.Xaml.CslaDataProvider.CslaDataProvider | ( | ) |
Creates an instance of the object.
Definition at line 32 of file CslaDataProvider.cs.
object Csla.Xaml.CslaDataProvider.AddNew | ( | ) |
Adds a new item to the object if the object implements IBindingList and AllowNew is true.
Definition at line 634 of file CslaDataProvider.cs.
|
protected |
Indicates that the control is about to initialize.
Definition at line 242 of file CslaDataProvider.cs.
|
protected |
Overridden.
Starts to create the requested object, either immediately or on a background thread, based on the value of the IsAsynchronous property.
Definition at line 263 of file CslaDataProvider.cs.
void Csla.Xaml.CslaDataProvider.Cancel | ( | ) |
Cancels changes to the business object, returning it to its previous state.
This metod does nothing unless ManageLifetime is set to true and the object supports n-level undo.
Definition at line 544 of file CslaDataProvider.cs.
|
protected |
Indicates that the control has initialized.
Definition at line 251 of file CslaDataProvider.cs.
|
protectedvirtual |
Raise the Saved event when the object has been saved.
newObject | New object reference as a result of the save operation. |
error | Reference to an exception object if an error occurred. |
userState | Reference to a userstate object. |
Definition at line 52 of file CslaDataProvider.cs.
void Csla.Xaml.CslaDataProvider.Rebind | ( | ) |
Triggers WPF data binding to rebind to the data object.
Definition at line 223 of file CslaDataProvider.cs.
void Csla.Xaml.CslaDataProvider.Refresh< T > | ( | Func< T > | factory | ) |
Refresh the ObjectInstance by calling the supplied factory.
T | Type of ObjectInstance |
factory | Sync data portal or factory method |
Definition at line 309 of file CslaDataProvider.cs.
async void Csla.Xaml.CslaDataProvider.Refresh< T > | ( | Func< Task< T > > | factory | ) |
Refresh the ObjectInstance by calling the supplied factory.
T | Type of ObjectInstance |
factory | Async data portal or factory method |
Definition at line 361 of file CslaDataProvider.cs.
void Csla.Xaml.CslaDataProvider.RemoveItem | ( | object | sender, |
ExecuteEventArgs | e | ||
) |
Removes an item from the list if the object implements IBindingList and AllowRemove is true.
sender | Object invoking this method. |
e | ExecuteEventArgs, where MethodParameter contains the item to be removed from the list. |
Definition at line 655 of file CslaDataProvider.cs.
void Csla.Xaml.CslaDataProvider.Save | ( | ) |
Accepts changes to the business object, and commits them by calling the object's Save() method.
This method does nothing unless the object implements Csla.Core.ISavable.
If the object implements IClonable, it will be cloned, and the clone will be saved.
If the object supports n-level undo and ManageLifetime is true, then this method will automatically call ApplyEdit() and BeginEdit() appropriately.
Definition at line 576 of file CslaDataProvider.cs.
|
get |
Gets an object that can be used to execute Save and Undo commands on this CslaDataProvider through XAML command bindings.
Definition at line 79 of file CslaDataProvider.cs.
|
getset |
Gets or sets a reference to an object that will handle the DataChanged event raised by this data provider.
This property is designed to reference an IErrorDialog control.
Definition at line 134 of file CslaDataProvider.cs.
|
getset |
Gets or sets the name of the static (Shared in Visual Basic) factory method that should be called to create the object instance.
Definition at line 156 of file CslaDataProvider.cs.
|
get |
Get the list of parameters to pass to the factory method.
Definition at line 173 of file CslaDataProvider.cs.
|
getset |
Gets or sets a value that indicates whether to perform object creation in a worker thread or in the active context.
Definition at line 186 of file CslaDataProvider.cs.
|
getprotected set |
Gets a value indicating if this object is busy.
Definition at line 209 of file CslaDataProvider.cs.
|
getset |
Gets or sets a value indicating whether the data control should manage the lifetime of the business object, including using n-level undo.
Definition at line 110 of file CslaDataProvider.cs.
|
getset |
Gets or sets a reference to the data object.
Definition at line 196 of file CslaDataProvider.cs.
|
getset |
Gets or sets the type of object to create an instance of.
Definition at line 91 of file CslaDataProvider.cs.
EventHandler<Csla.Core.SavedEventArgs> Csla.Xaml.CslaDataProvider.Saved |
Event raised when the object has been saved.
Definition at line 43 of file CslaDataProvider.cs.