diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2017-12-04 13:41:01 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2017-12-04 13:41:01 +0200 |
| commit | c47075cc333329fc6bc93679d847cadcb050436f (patch) | |
| tree | 7d6400a6008598925fff341d3b4ef38f3074c081 /Software/Visual_Studio/Tango.SharedUI/ViewModel.cs | |
| parent | 326925941657d0e6968103e60ec1972fab64d4b0 (diff) | |
| download | Tango-c47075cc333329fc6bc93679d847cadcb050436f.tar.gz Tango-c47075cc333329fc6bc93679d847cadcb050436f.zip | |
Added MVVMLight nuget.
Implemented ViewModel IView, supervising controller pattern.
Diffstat (limited to 'Software/Visual_Studio/Tango.SharedUI/ViewModel.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.SharedUI/ViewModel.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.SharedUI/ViewModel.cs b/Software/Visual_Studio/Tango.SharedUI/ViewModel.cs new file mode 100644 index 000000000..d0c08fb3a --- /dev/null +++ b/Software/Visual_Studio/Tango.SharedUI/ViewModel.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.SharedUI +{ + public abstract class ViewModel<T> where T : IView + { + public T View { get; set; } + + public ViewModel(T view) + { + View = view; + View.ViewAttached += (x, e) => + { + View = (T)e; + OnViewAttached(); + }; + } + + protected virtual void OnViewAttached() + { + + } + } +} |
