Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Bootstrapper : BootstrapperBase
- {
- private readonly ElementHost _host;
- // 以 ViewModel First Approach
- private ShellViewModel ShellVM;
- public Bootstrapper(ElementHost host) : base(false)
- {
- this._host = host;
- this.Initialize();
- }
- protected override void StartRuntime()
- {
- base.StartRuntime();
- ShellVM = IoC.Get <ShellViewModel>();
- var view = ViewLocator.LocateForModel(ShellVM, null, null);
- ViewModelBinder.Bind(ShellVM, view, null);
- var activator = ShellVM as IActivate;
- if (activator != null)
- activator.Activate();
- _host.Child = view;
- }
- protected override IEnumerable<System.Reflection.Assembly> SelectAssemblies()
- {
- return base.SelectAssemblies().Where(x => !AssemblySource.Instance.Contains(x));
- }
- public void Start()
- {
- ShellVM.Start();
- }
- public void Stop()
- {
- ShellVM.Stop();
- }
- }
Add Comment
Please, Sign In to add comment