Table of Contents

Class ContentModel<T>

Namespace
The.WPF.Screens
Assembly
Instagile.WPF.dll
[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

surface ISurface
entity T
lookupContext IEntityContext
fields IReadOnlyList<IField>
sections IReadOnlyList<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

bool

CancelCommand

can be invoked to cancel a screen

public IScreenCommand? CancelCommand { get; set; }

Property Value

IScreenCommand

Commands

this collection may be modified to change the screen's set of commands

public IReadOnlyList<IScreenCommand> Commands { get; set; }

Property Value

IReadOnlyList<IScreenCommand>

ConfirmCommand

can be invoked as the default action of a screen.

public IScreenCommand? ConfirmCommand { get; set; }

Property Value

IScreenCommand

Entity

public T Entity { get; }

Property Value

T

Fields

[DataMember]
public IReadOnlyList<IField> Fields { get; }

Property Value

IReadOnlyList<IField>

HasChanges

public virtual bool HasChanges { get; }

Property Value

bool

HasTitleBar

If false, the title and commands will not be displayed.

public bool HasTitleBar { get; set; }

Property Value

bool

HeroSections

public ObservableCollection<ISection> HeroSections { get; }

Property Value

ObservableCollection<ISection>

Icons

this collection may be modified to change the icons displayed next to the title

public IReadOnlyList<IconModel> Icons { get; set; }

Property Value

IReadOnlyList<IconModel>

IsEditable

public bool IsEditable { get; }

Property Value

bool

IsEditableRW

public bool IsEditableRW { get; set; }

Property Value

bool

IsEnabled

public bool IsEnabled { get; set; }

Property Value

bool

IsValid

public virtual bool IsValid { get; }

Property Value

bool

MaximizedSection

The section currently taking over the whole content area, or null when the normal layout is showing.

public ISection? MaximizedSection { get; }

Property Value

ISection

RefreshCommand

can be invoked commands to reload a screen's data.

public IScreenCommand? RefreshCommand { get; set; }

Property Value

IScreenCommand

SaveCommand

can be invoked to store a screen's data.

public IScreenCommand? SaveCommand { get; set; }

Property Value

IScreenCommand

ScreenTitle

this property may be set or modified to change the screen's title

public virtual string ScreenTitle { get; set; }

Property Value

string

Sections

public ObservableCollection<ISection> Sections { get; }

Property Value

ObservableCollection<ISection>

Services

public IServices Services { get; }

Property Value

IServices

SharedLookupContext

public IEntityContext? SharedLookupContext { get; }

Property Value

IEntityContext

Surface

set by constructor- every screenmodel must be 'located on' a shell-defined IScreen

public ISurface Surface { get; }

Property Value

ISurface

Methods

FindField(string)

public IField? FindField(string name)

Parameters

name string

Returns

IField

FindSection(string)

public ISection? FindSection(string name)

Parameters

name string

Returns

ISection

GetBlockingChangesAsync()

public virtual Task<IEnumerable<Change>> GetBlockingChangesAsync()

Returns

Task<IEnumerable<Change>>

InvalidateSectionVisibility()

public void InvalidateSectionVisibility()

RaisePropertyChanged(string)

protected void RaisePropertyChanged(string propertyName)

Parameters

propertyName string

RaisePropertyChanged(params string[])

protected void RaisePropertyChanged(params string[] propertyNames)

Parameters

propertyNames string[]

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

binder GetMemberBinder

Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the Console.WriteLine(sampleObject.SampleProperty) statement, where sampleObject is an instance of the class derived from the DynamicObject class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive.

result object

The 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

binder SetMemberBinder

Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member to which the value is being assigned. For example, for the statement sampleObject.SampleProperty = "Test", where sampleObject is an instance of the class derived from the DynamicObject class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive.

value object

The value to set to the member. For example, for sampleObject.SampleProperty = "Test", where sampleObject is an instance of the class derived from the DynamicObject class, the value is "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

Event Type

PropertyChangedEventHandler