aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-06-12 19:04:09 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-06-12 19:04:09 +0300
commitca50e0c8fc88acd06d6e1932e9412464bff95edb (patch)
treeaaafb06deca983c1e80c8c34508d23a452e4a235 /Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs
parent8a59643571080bfff715f0b0e4bb03e2dee4961a (diff)
downloadTango-ca50e0c8fc88acd06d6e1932e9412464bff95edb.tar.gz
Tango-ca50e0c8fc88acd06d6e1932e9412464bff95edb.zip
Working on PPC modules and loading.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs25
1 files changed, 25 insertions, 0 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs
index d9d7097e0..ffe5c9a4f 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Tango.BL;
using Tango.Core.DI;
using Tango.PPC.Common.Application;
using Tango.PPC.Common.Authentication;
@@ -15,6 +16,11 @@ namespace Tango.PPC.Common
{
public abstract class PPCViewModel : ViewModel
{
+ public ObservablesEntitiesAdapter Adapter
+ {
+ get { return ObservablesEntitiesAdapter.Instance; }
+ }
+
[TangoInject]
public IPPCApplicationManager ApplicationManager { get; set; }
@@ -54,4 +60,23 @@ namespace Tango.PPC.Common
}
}
+
+ public abstract class PPCViewModel<T> : PPCViewModel where T : IPPCView
+ {
+ public T View { get; private set; }
+
+ public bool ViewAttached { get; private set; }
+
+ public override void OnApplicationStarted()
+ {
+ TangoIOC.Default.GetInstanceWhenAvailable<T>((view) =>
+ {
+ ViewAttached = true;
+ View = view;
+ OnViewAttached();
+ });
+ }
+
+ public abstract void OnViewAttached();
+ }
} \ No newline at end of file