Exemplo n.º 1
0
 public DefaultApp(Type startViewModelType, IViewModelSettings viewModelSettings = null, LoadMode mode = LoadMode.Runtime)
     : base(mode)
 {
     Should.NotBeNull(startViewModelType, "startViewModelType");
     Should.BeOfType <IViewModel>(startViewModelType, "startViewModelType");
     _startViewModelType = startViewModelType;
     _viewModelSettings  = viewModelSettings;
 }
Exemplo n.º 2
0
 protected virtual void OnInitialize(IList <Assembly> assemblies)
 {
     LoadModules(assemblies);
     if (!IocContainer.TryGet(out _viewModelSettings))
     {
         _viewModelSettings = CreateViewModelSettings();
         IocContainer.BindToConstant(_viewModelSettings);
     }
 }
Exemplo n.º 3
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="Bootstrapper{TRootViewModel}" /> class.
        /// </summary>
        public Bootstrapper([NotNull] IIocContainer iocContainer, IEnumerable <Assembly> assemblies = null,
                            IViewModelSettings viewModelSettings = null, params IModule[] modules)
#endif
        {
            Should.NotBeNull(iocContainer, "iocContainer");
            _iocContainer      = iocContainer;
            _assemblies        = assemblies;
            _viewModelSettings = viewModelSettings;
            _modules           = modules.IsNullOrEmpty() ? null : modules;
        }
Exemplo n.º 4
0
        public Bootstrapper([NotNull] IIocContainer iocContainer, IEnumerable <Assembly> assemblies = null,
                            IViewModelSettings viewModelSettings = null, PlatformInfo platform = null)
            : base(platform)
#endif
        {
            Should.NotBeNull(iocContainer, "iocContainer");
            _iocContainer      = iocContainer;
            _assemblies        = assemblies;
            _viewModelSettings = viewModelSettings;
        }
Exemplo n.º 5
0
        /// <summary>
        ///     Initializes the current bootstraper.
        /// </summary>
        protected virtual void OnInitialize()
        {
            LoadModules();
            IViewModelSettings settings = CreateViewModelSettings();

            if (!IocContainer.CanResolve <IViewModelSettings>())
            {
                IocContainer.BindToConstant(settings);
            }
            ServiceProvider.Initialize(IocContainer, Platform);
        }
Exemplo n.º 6
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="ViewModelBase" /> class.
        /// </summary>
        protected ViewModelBase()
        {
            _busyCollection           = new Dictionary <Guid, object>();
            _disposeCancellationToken = new CancellationTokenSource();
            _settings = ApplicationSettings.ViewModelSettings.Clone();
            _viewModelEventAggregator = ServiceProvider.InstanceEventAggregatorFactory(this);

            Tracer.TraceViewModel(AuditAction.Created, this);
            if (IsDesignMode)
            {
                ServiceProvider.DesignTimeManager.InitializeViewModel(this);
            }
        }
Exemplo n.º 7
0
        protected ViewModelBase()
        {
            var current = MvvmApplication.Current;

            if (current == null || current.ViewModelSettings == null)
            {
                _settings = new DefaultViewModelSettings();
            }
            else
            {
                _settings = current.ViewModelSettings.Clone();
            }
            Tracer.TraceViewModel(AuditAction.Created, this);
            if (IsDesignMode)
            {
                ServiceProvider.DesignTimeManager.InitializeViewModel(this);
            }
        }
Exemplo n.º 8
0
 public SplitViewBootstrapper(IEnumerable <Assembly> assemblies    = null,
                              IViewModelSettings viewModelSettings = null,
                              PlatformInfo platform = null)
     : base(new Frame(), new AutofacContainer(), assemblies, viewModelSettings, platform)
 {
 }
Exemplo n.º 9
0
 protected virtual void OnInitialize(IList<Assembly> assemblies)
 {
     LoadModules(assemblies);
     if (!IocContainer.TryGet(out _viewModelSettings))
     {
         _viewModelSettings = CreateViewModelSettings();
         IocContainer.BindToConstant(_viewModelSettings);
     }
 }
 public SplitViewBootstrapper(UIWindow window, IIocContainer iocContainer,
                              IEnumerable <Assembly> assemblies = null, IViewModelSettings viewModelSettings = null,
                              PlatformInfo platform             = null) : base(window, iocContainer, assemblies, viewModelSettings, platform)
 {
     WrapToNavigationController = UIDevice.CurrentDevice.UserInterfaceIdiom != UIUserInterfaceIdiom.Pad;
 }
Exemplo n.º 11
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="Bootstrapper{TRootViewModel}" /> class.
 /// </summary>
 public Bootstrapper([NotNull] UIWindow window, [NotNull] IIocContainer iocContainer, IEnumerable <Assembly> assemblies = null,
                     IViewModelSettings viewModelSettings = null, params IModule[] modules)
     : base(window)
Exemplo n.º 12
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="Bootstrapper{TRootViewModel}" /> class.
 /// </summary>
 public Bootstrapper([NotNull] Frame rootFrame, [NotNull] IIocContainer iocContainer, IEnumerable <Assembly> assemblies = null,
                     IViewModelSettings viewModelSettings = null, params IModule[] modules)
     : base(rootFrame, assemblies != null)
Exemplo n.º 13
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="Bootstrapper{TRootViewModel}" /> class.
 /// </summary>
 public Bootstrapper([NotNull] Application application, [NotNull] IIocContainer iocContainer, IEnumerable <Assembly> assemblies = null,
                     IViewModelSettings viewModelSettings = null, params IModule[] modules)
     : base(application, true)
Exemplo n.º 14
0
 public Bootstrapper([NotNull] UIWindow window, [NotNull] IIocContainer iocContainer, IEnumerable <Assembly> assemblies = null, IViewModelSettings viewModelSettings = null, PlatformInfo platform = null)
     : base(window, platform)
Exemplo n.º 15
0
 public Bootstrapper([NotNull] Frame rootFrame, [NotNull] IIocContainer iocContainer, IEnumerable <Assembly> assemblies = null, IViewModelSettings viewModelSettings = null, PlatformInfo platform = null)
     : base(rootFrame, assemblies != null, platform)
Exemplo n.º 16
0
 public Bootstrapper([NotNull] Application application, [NotNull] IIocContainer iocContainer, IEnumerable <Assembly> assemblies = null, IViewModelSettings viewModelSettings = null, PlatformInfo platform = null)
     : base(application, platform: platform)