From 7b69f9a96ab82e3a6e2345092600edf5854f5f4f Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Sat, 29 Dec 2018 00:22:20 +0200 Subject: Added DISPENSERS & SPOOLS tables. Modified Observable Entities to have an On****Changed methods ! --- .../Templates/EntityCodeFile.cshtml | 23 +++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'Software/Visual_Studio/Tango.CodeGeneration') diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml index daa4e7d51..dfcceb1dd 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml +++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml @@ -77,15 +77,32 @@ namespace Tango.BL.Entities @if (!prop.Name.EndsWith("Guid")) {
- @(prop.Name)Changed?.Invoke(this, value); + On@(prop.Name)Changed(value);
- } - RaisePropertyChanged(nameof(@(prop.Name))); + } } } } } + + + @foreach (var prop in Model.Fields) + { + if (!prop.Name.EndsWith("Guid")) + { +
+ /// + /// Called when the @(prop.Name) has changed. + /// + protected virtual void On@(prop.Name)Changed(@(prop.Type) @(prop.Name.ToLower())) + { + @(prop.Name)Changed?.Invoke(this, @(prop.Name.ToLower())); + RaisePropertyChanged(nameof(@(prop.Name))); + } +
+ } + } /// /// Initializes a new instance of the class. -- cgit v1.3.1