1#if !XAMARIN && !WINDOWS_UWP
11using System.ComponentModel;
31#region Per-Type Dependency Properties
33 private static readonly DependencyProperty CanCreateProperty =
34 DependencyProperty.Register(
"CanCreateObject", typeof(
bool), typeof(
ObjectStatus),
new FrameworkPropertyMetadata(
false),
null);
35 private static readonly DependencyProperty CanGetProperty =
36 DependencyProperty.Register(
"CanGetObject", typeof(
bool), typeof(
ObjectStatus),
new FrameworkPropertyMetadata(
false),
null);
37 private static readonly DependencyProperty CanEditProperty =
38 DependencyProperty.Register(
"CanEditObject", typeof(
bool), typeof(
ObjectStatus),
new FrameworkPropertyMetadata(
false),
null);
39 private static readonly DependencyProperty CanDeleteProperty =
40 DependencyProperty.Register(
"CanDeleteObject", typeof(
bool), typeof(
ObjectStatus),
new FrameworkPropertyMetadata(
false),
null);
48 get {
return (
bool)base.GetValue(CanCreateProperty); }
52 base.SetValue(CanCreateProperty, value);
55 new DependencyPropertyChangedEventArgs(CanCreateProperty, old, value));
65 get {
return (
bool)base.GetValue(CanGetProperty); }
69 base.SetValue(CanGetProperty, value);
72 new DependencyPropertyChangedEventArgs(CanGetProperty, old, value));
82 get {
return (
bool)base.GetValue(CanEditProperty); }
86 base.SetValue(CanEditProperty, value);
89 new DependencyPropertyChangedEventArgs(CanEditProperty, old, value));
99 get {
return (
bool)base.GetValue(CanDeleteProperty); }
103 base.SetValue(CanDeleteProperty, value);
106 new DependencyPropertyChangedEventArgs(CanDeleteProperty, old, value));
112#region Per-Instance Dependency Properties
114 private static readonly DependencyProperty IsDeletedProperty =
115 DependencyProperty.Register(
"IsDeleted", typeof(
bool), typeof(
ObjectStatus),
new FrameworkPropertyMetadata(
false),
null);
116 private static readonly DependencyProperty IsDirtyProperty =
117 DependencyProperty.Register(
"IsDirty", typeof(
bool), typeof(
ObjectStatus),
new FrameworkPropertyMetadata(
false),
null);
118 private static readonly DependencyProperty IsNewProperty =
119 DependencyProperty.Register(
"IsNew", typeof(
bool), typeof(
ObjectStatus),
new FrameworkPropertyMetadata(
false),
null);
120 private static readonly DependencyProperty IsSavableProperty =
121 DependencyProperty.Register(
"IsSavable", typeof(
bool), typeof(
ObjectStatus),
new FrameworkPropertyMetadata(
false),
null);
122 private static readonly DependencyProperty IsValidProperty =
123 DependencyProperty.Register(
"IsValid", typeof(
bool), typeof(
ObjectStatus),
new FrameworkPropertyMetadata(
false),
null);
131 get {
return (
bool)base.GetValue(IsDeletedProperty); }
135 base.SetValue(IsDeletedProperty, value);
137 new DependencyPropertyChangedEventArgs(IsDeletedProperty, old, value));
147 get {
return (
bool)base.GetValue(IsDirtyProperty); }
151 base.SetValue(IsDirtyProperty, value);
154 new DependencyPropertyChangedEventArgs(IsDirtyProperty, old, value));
164 get {
return (
bool)base.GetValue(IsNewProperty); }
168 base.SetValue(IsNewProperty, value);
171 new DependencyPropertyChangedEventArgs(IsNewProperty, old, value));
181 get {
return (
bool)base.GetValue(IsSavableProperty); }
185 base.SetValue(IsSavableProperty, value);
188 new DependencyPropertyChangedEventArgs(IsSavableProperty, old, value));
198 get {
return (
bool)base.GetValue(IsValidProperty); }
202 base.SetValue(IsValidProperty, value);
205 new DependencyPropertyChangedEventArgs(IsValidProperty, old, value));
211#region Base Overrides
304 if (sourceList !=
null)
Tracks the business rules for a business object.
static bool HasPermission(ApplicationContext applicationContext, AuthorizationActions action, Type objectType)
Checks per-type authorization rules.
ApplicationContextManager for WPF applications
static ApplicationContext GetApplicationContext()
Gets the current ApplicationContext.
Base class for creating WPF panel controls that react when the DataContext, data object and data prop...
object DataObject
Gets a reference to the current data object.
Container for other UI controls that exposes various status values from the CSLA ....
override void DataObservableCollectionChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
This method is called if the data object is an INotifyCollectionChanged, and the CollectionChanged ev...
bool CanGetObject
Exposes the CanGetObject property of the DataContext business object.
override void DataPropertyChanged(PropertyChangedEventArgs e)
This method is called when a property of the data object to which the control is bound has changed.
bool IsValid
Exposes the IsValid property of the DataContext business object.
void Refresh()
Refreshes the control's property values to reflect the values of the underlying business object.
override void DataObjectChanged()
This method is called when the data object to which the control is bound has changed.
bool CanCreateObject
Exposes the CanCreateObject property of the DataContext business object.
bool CanEditObject
Exposes the CanEditObject property of the DataContext business object.
override void DataBindingListChanged(ListChangedEventArgs e)
This method is called if the data object is an IBindingList, and the ListChanged event was raised by ...
bool IsDirty
Exposes the IsDirty property of the DataContext business object.
bool IsSavable
Exposes the IsSavable property of the DataContext business object.
bool IsDeleted
Exposes the IsDeleted property of the DataContext business object.
bool CanDeleteObject
Exposes the CanDeleteObject property of the DataContext business object.
bool IsNew
Exposes the IsNew property of the DataContext business object.
Defines the common methods required by all editable CSLA single objects.
Defines the common methods required by all editable CSLA collection objects.
bool IsSavable
Returns true if this object is both dirty and valid.
bool IsDeleted
Returns true if this object is marked for deletion.
bool IsNew
Returns true if this is a new object, false if it is a pre-existing object.
bool IsValid
Returns true if the object and its child objects are currently valid, false if the object or any of i...
bool IsDirty
Returns true if this object's data, or any of its fields or child objects data, has been changed.