10using System.Collections.Generic;
11using System.ComponentModel;
22 private object Model {
get; }
23 private string PropertyName {
get; }
33 PropertyName = propertyName;
34 if (Model is INotifyPropertyChanged npc)
36 npc.PropertyChanged += Npc_PropertyChanged;
40 private void Npc_PropertyChanged(
object sender, PropertyChangedEventArgs e)
42 if (e.PropertyName ==
"IsBusy")
43 OnPropertyChanged(nameof(
IsBusy));
52 foreach (var item
in this.GetType().GetProperties())
53 OnPropertyChanged(item.Name);
65 var result =
string.Empty;
66 if (Model is Core.BusinessBase obj)
67 result = obj.BrokenRulesCollection.ToString(
",",
RuleSeverity.Error, PropertyName);
81 var result =
string.Empty;
82 if (Model is Core.BusinessBase obj)
83 result = obj.BrokenRulesCollection.ToString(
",",
RuleSeverity.Warning, PropertyName);
97 var result =
string.Empty;
98 if (Model is Core.BusinessBase obj)
99 result = obj.BrokenRulesCollection.ToString(
",",
RuleSeverity.Information, PropertyName);
113 if (Model is Security.IAuthorizeReadWrite obj)
114 return obj.CanReadProperty(PropertyName);
129 if (Model is Security.IAuthorizeReadWrite obj)
130 return obj.CanWriteProperty(PropertyName);
145 if (Model is Core.BusinessBase obj)
146 return obj.IsPropertyBusy(PropertyName);
157 private void OnPropertyChanged(
string propertyName)
159 PropertyChanged?.Invoke(
this,
new PropertyChangedEventArgs(propertyName));
Exposes metastate for a property.
string InformationText
Gets the validation information messages for a property on the Model
bool CanRead
Gets a value indicating whether the current user is authorized to read the property on the Model
string WarningText
Gets the validation warning messages for a property on the Model
string ErrorText
Gets the validation error messages for a property on the Model
bool CanWrite
Gets a value indicating whether the current user is authorized to change the property on the Model
PropertyInfo(object model, string propertyName)
Creates an instance of the type.
PropertyChangedEventHandler PropertyChanged
Event raised when a property changes.
void Refresh()
Indicate that all properties have changed to trigger a UI refresh of all values.
bool IsBusy
Gets a value indicating whether the property on the Model is busy
RuleSeverity
Values for validation rule severities.