diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-08-08 13:35:27 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-08-08 13:35:27 +0300 |
| commit | 57ae9d131e898a35061507bc8497bcf648cf00d1 (patch) | |
| tree | 91e5c55fdcced791f509b24d13c4a73294a295f2 /Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs | |
| parent | 8dac70e25c92eea8278c564615509386a1a0182d (diff) | |
| download | Tango-57ae9d131e898a35061507bc8497bcf648cf00d1.tar.gz Tango-57ae9d131e898a35061507bc8497bcf648cf00d1.zip | |
Working on machine setup !
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs index b9114dba4..b2475b139 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs @@ -173,10 +173,22 @@ namespace Tango.PPC.Common /// <seealso cref="Tango.SharedUI.ViewModel" /> public abstract class PPCViewModel<T> : PPCViewModel where T : IPPCView { + private T _view; /// <summary> /// Gets the IPPCView instance. /// </summary> - public T View { get; private set; } + [TangoInject(TangoInjectMode.WhenAvailable)] + public T View + { + get { return _view; } + set + { + _view = value; + ViewAttached = true; + OnViewAttached(); + } + } + /// <summary> /// Gets a value indicating whether the instance of IPPCView is available. @@ -188,12 +200,7 @@ namespace Tango.PPC.Common /// </summary> public override void OnApplicationStarted() { - TangoIOC.Default.GetInstanceWhenAvailable<T>((view) => - { - ViewAttached = true; - View = view; - OnViewAttached(); - }); + } /// <summary> |
