diff options
| author | Roy <roy.mail.net@gmail.com> | 2017-12-09 00:31:12 +0200 |
|---|---|---|
| committer | Roy <roy.mail.net@gmail.com> | 2017-12-09 00:31:12 +0200 |
| commit | cf7af2bc991e99b9dc82f4f54784d0eaa9a043b0 (patch) | |
| tree | b87a44c720b745294eb021b4393a43d480da3961 /Software/Visual_Studio/Tango.SharedUI/ViewModel.cs | |
| parent | db4db5d05b42cbc795b3a38bba3e6c87f30d583f (diff) | |
| download | Tango-cf7af2bc991e99b9dc82f4f54784d0eaa9a043b0.tar.gz Tango-cf7af2bc991e99b9dc82f4f54784d0eaa9a043b0.zip | |
Stubs execution utility almost done.
Diffstat (limited to 'Software/Visual_Studio/Tango.SharedUI/ViewModel.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.SharedUI/ViewModel.cs | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Tango.SharedUI/ViewModel.cs b/Software/Visual_Studio/Tango.SharedUI/ViewModel.cs index dc8eeff8c..281a6c03d 100644 --- a/Software/Visual_Studio/Tango.SharedUI/ViewModel.cs +++ b/Software/Visual_Studio/Tango.SharedUI/ViewModel.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Tango.Core; @@ -19,13 +20,32 @@ namespace Tango.SharedUI public ViewModel(T view) { View = view; - View.ViewAttached += (x, e) => + View.ViewAttached += (x, e) => { View = (T)e; OnViewAttached(); }; } + public ViewModel(T view, bool delayed) + { + Task.Factory.StartNew(() => + { + while (view == null) + { + Thread.Sleep(10); + } + }).ContinueWith((c) => + { + View = view; + View.ViewAttached += (x, e) => + { + View = (T)e; + OnViewAttached(); + }; + }); + } + protected virtual void OnViewAttached() { |
