Class ContentModel<T>
[DataContract]
public class ContentModel<T> : DynamicObject, IDynamicMetaObjectProvider, IScreenModel, IModel, INotifyPropertyChanged where T : IEntity
Type Parameters
T
- Inheritance
-
ContentModel<T>
- Implements
- Inherited Members
- Extension Methods
Constructors
ContentModel(ISurface, T, IEntityContext?, IReadOnlyList<IField>, IReadOnlyList<ISection>)
public ContentModel(ISurface surface, T entity, IEntityContext? lookupContext, IReadOnlyList<IField> fields, IReadOnlyList<ISection> sections)
Parameters
surfaceISurfaceentityTlookupContextIEntityContextfieldsIReadOnlyList<IField>sectionsIReadOnlyList<ISection>
Properties
AreCommandsEnabled
Indicates whether the screen's commands are enabled. Commands may still be disabled individually even if this returns true
public virtual bool AreCommandsEnabled { get; }
Property Value
CancelCommand
can be invoked to cancel a screen
public IScreenCommand? CancelCommand { get; set; }
Property Value
Commands
this collection may be modified to change the screen's set of commands
public IReadOnlyList<IScreenCommand> Commands { get; set; }
Property Value
ConfirmCommand
can be invoked as the default action of a screen.
public IScreenCommand? ConfirmCommand { get; set; }
Property Value
Entity
public T Entity { get; }
Property Value
- T
Fields
[DataMember]
public IReadOnlyList<IField> Fields { get; }
Property Value
HasChanges
public virtual bool HasChanges { get; }
Property Value
HasTitleBar
If false, the title and commands will not be displayed.
public bool HasTitleBar { get; set; }
Property Value
HeroSections
public ObservableCollection<ISection> HeroSections { get; }
Property Value
Icons
this collection may be modified to change the icons displayed next to the title
public IReadOnlyList<IconModel> Icons { get; set; }
Property Value
IsEditable
public bool IsEditable { get; }
Property Value
IsEditableRW
public bool IsEditableRW { get; set; }
Property Value
IsEnabled
public bool IsEnabled { get; set; }
Property Value
IsValid
public virtual bool IsValid { get; }
Property Value
MaximizedSection
The section currently taking over the whole content area, or null when the normal layout is showing.
public ISection? MaximizedSection { get; }
Property Value
RefreshCommand
can be invoked commands to reload a screen's data.
public IScreenCommand? RefreshCommand { get; set; }
Property Value
SaveCommand
can be invoked to store a screen's data.
public IScreenCommand? SaveCommand { get; set; }
Property Value
ScreenTitle
this property may be set or modified to change the screen's title
public virtual string ScreenTitle { get; set; }
Property Value
Sections
public ObservableCollection<ISection> Sections { get; }
Property Value
Services
public IServices Services { get; }
Property Value
SharedLookupContext
public IEntityContext? SharedLookupContext { get; }
Property Value
Surface
set by constructor- every screenmodel must be 'located on' a shell-defined IScreen
public ISurface Surface { get; }
Property Value
Methods
FindField(string)
public IField? FindField(string name)
Parameters
namestring
Returns
FindSection(string)
public ISection? FindSection(string name)
Parameters
namestring
Returns
GetBlockingChangesAsync()
public virtual Task<IEnumerable<Change>> GetBlockingChangesAsync()
Returns
InvalidateSectionVisibility()
public void InvalidateSectionVisibility()
RaisePropertyChanged(string)
protected void RaisePropertyChanged(string propertyName)
Parameters
propertyNamestring
RaisePropertyChanged(params string[])
protected void RaisePropertyChanged(params string[] propertyNames)
Parameters
propertyNamesstring[]
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
TryGetMember(GetMemberBinder, out object?)
Provides the implementation for operations that get member values. Classes derived from the DynamicObject class can override this method to specify dynamic behavior for operations such as getting a value for a property.
public override bool TryGetMember(GetMemberBinder binder, out object? result)
Parameters
binderGetMemberBinderProvides information about the object that called the dynamic operation. The
binder.Nameproperty provides the name of the member on which the dynamic operation is performed. For example, for theConsole.WriteLine(sampleObject.SampleProperty)statement, wheresampleObjectis an instance of the class derived from the DynamicObject class,binder.Namereturns "SampleProperty". Thebinder.IgnoreCaseproperty specifies whether the member name is case-sensitive.resultobjectThe result of the get operation. For example, if the method is called for a property, you can assign the property value to
result.
Returns
- bool
true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a run-time exception is thrown.)
TrySetMember(SetMemberBinder, object?)
Provides the implementation for operations that set member values. Classes derived from the DynamicObject class can override this method to specify dynamic behavior for operations such as setting a value for a property.
public override bool TrySetMember(SetMemberBinder binder, object? value)
Parameters
binderSetMemberBinderProvides information about the object that called the dynamic operation. The
binder.Nameproperty provides the name of the member to which the value is being assigned. For example, for the statementsampleObject.SampleProperty = "Test", wheresampleObjectis an instance of the class derived from the DynamicObject class,binder.Namereturns "SampleProperty". Thebinder.IgnoreCaseproperty specifies whether the member name is case-sensitive.valueobjectThe value to set to the member. For example, for
sampleObject.SampleProperty = "Test", wheresampleObjectis an instance of the class derived from the DynamicObject class, thevalueis "Test".
Returns
- bool
true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.)
Events
PropertyChanged
Occurs when a property value changes.
public event PropertyChangedEventHandler? PropertyChanged