Example #1
0
        public ShellViewModel(IEventAggregator events, SalesViewModel salesVM)
        {
            _events  = events;
            _salesVM = salesVM;

            _events.Subscribe(this);
            ActivateItem(IoC.Get <LoginViewModel>());
        }
 //Dependency injection.
 //Sales view and events these events are needed to be saved in the instance.
 public ShellViewModel(IEventAggregator events, SalesViewModel salesVM, ILoggedInUserModel user, IAPIHelper apiHelper)
 {
     _events    = events;
     _salesVM   = salesVM;
     _user      = user;
     _apiHelper = apiHelper;
     _events.Subscribe(this);
     ActivateItem(IoC.Get <LoginViewModel>()); // login view models is per request. IOC is in version control , calibrurn micro biring in . which allows the contrainer to get instances.
 }
 public ShellViewModel(IEventAggregator events, SalesViewModel salesVW,
                       SimpleContainer container)
 {
     _events    = events;
     _container = container;
     _salesVW   = salesVW;
     _events.Subscribe(this);
     ActivateItem(_container.GetInstance <LoginViewModel>());
 }
Example #4
0
        public ShellViewModel(IEventAggregator events, SalesViewModel salesVM, SimpleContainer container)
        {
            _events    = events;
            _salesVM   = salesVM;
            _container = container;

            _events.Subscribe(this);

            ActivateItem(_container.GetInstance <LoginViewModel>()); // It's always a fresh instance because it is not a singleton
        }
 public ShellViewModel(IEventAggregator events, SalesViewModel salesViewModel, SimpleContainer simpleContainer, ILoggedInUserModel loggedOnUser, IAPIHelper aPIHelper)
 {
     Events            = events;
     SalesViewModel    = salesViewModel;
     SimpleContainer   = simpleContainer;
     this.loggedOnUser = loggedOnUser;
     this.aPIHelper    = aPIHelper;
     events.Subscribe(this);
     ActivateItem(SimpleContainer.GetInstance <LoginViewModel>());
 }
        public ShellViewModel(IEventAggregator events, SalesViewModel salesVM, ILoggedInUserModel user, IAPIHelper apiHelper)
        {
            _events    = events;
            _salesVM   = salesVM;
            _user      = user;
            _apiHelper = apiHelper;

            _events.SubscribeOnPublishedThread(this);

            ActivateItemAsync(IoC.Get <LoginViewModel>(), new CancellationToken());
        }
Example #7
0
        public ShellViewModel(IEventAggregator events, SalesViewModel salesVM,
                              SimpleContainer container)
        {
            _events    = events;
            _salesVM   = salesVM;
            _container = container;

            _events.SubscribeOnPublishedThread(this);

            ActivateItemAsync(_container.GetInstance <LoginViewModel>());
        }
        public ShellViewModel(IEventAggregator events, SalesViewModel salesViewModel)
        {
            _events         = events;
            _salesViewModel = salesViewModel;

            _events.Subscribe(this);

            var loginViewModel = IoC.Get <LoginViewModel>();

            ActivateItem(loginViewModel);
        }
        public ShellViewModel(IEventAggregator events, SalesViewModel salevVM, SimpleContainer container, ILoggedInUserModel user, IAPIHelper apiHelper)
        {
            _salevVM   = salevVM;
            _events    = events;
            _user      = user;
            _apiHelper = apiHelper;

            _events.Subscribe(this);

            ActivateItem(IoC.Get <LoginViewModel>());
        }
        public ShellViewModel(IEventAggregator events, SalesViewModel salesVM, SimpleContainer container)
        {
            _events    = events;
            _salesVM   = salesVM;
            _container = container;

            _events.Subscribe(this);

            // gives us a clean login form whenever we need it
            ActivateItem(_container.GetInstance <LoginViewModel>());
        }
Example #11
0
        public ShellViewModel(IEventAggregator eventAggregator, SalesViewModel salesViewModel, ILoggedInUserModel loggedInUserModel, IAPIHelper apiHelper)
        {
            _eventAggregator   = eventAggregator;
            _salesViewModel    = salesViewModel;
            _loggedInUserModel = loggedInUserModel;
            _apiHelper         = apiHelper;
            _eventAggregator.Subscribe(this); // Subscribe this class to the event aggregator

            // Starts LoginView, and since its not a singleton we get a fresh instance
            ActivateItem(IoC.Get <LoginViewModel>());
        }
Example #12
0
        //private SimpleContainer _container;

        public ShellViewModel(IEventAggregator events, SalesViewModel salesVM)//, SimpleContainer container)//constructor injection
        {
            _events = events;

            _salesVM = salesVM;
            //_container = container;

            _events.Subscribe(this);

            ActivateItem(IoC.Get <LoginViewModel>()); //Do this instead of "ActivateItem(_loginVM) so that every time I have a new instance without the previous user data
            //with Inversion of Control(caliburn micro) i don't have to pass an instance of container
        }
        public ShellViewModel(LoginViewModel loginVM, IEventAggregator events, SalesViewModel salesVM, ILoggedInUserModel user, IAPIHelper aPIHelper)
        {
            _events    = events;
            _salesVM   = salesVM;
            _user      = user;
            _aPIHelper = aPIHelper;

            // Subscribing to all events of IHandle<A>, IHandle<B>...
            _events.Subscribe(this);

            // Get a brand new instance of LoginViewModel and activate it.
            ActivateItem(IoC.Get <LoginViewModel>());
        }
Example #14
0
        public ShellViewModel(IEventAggregator events, SalesViewModel salesVM, SimpleContainer container)
        {
            _events    = events;
            _salesVM   = salesVM;
            _container = container;

            // Have to subscribe to have it listen.
            _events.Subscribe(this);

            // If you pass it in here fresh every time, then a new model is passed each time and accidental storage isn't kept.
            // Don't use it for sales and event as it will wipe carts out / lose events
            // .
            ActivateItem(_container.GetInstance <LoginViewModel>());
        }
        //private SimpleContainer _container;

        public ShellViewModel(IEventAggregator events, SalesViewModel salesVM, ILoggedInUserModel user, IAPIHelper apiHelper)
        {
            //_loginVM = loginVM;
            _salesVM   = salesVM;
            _user      = user;
            _apiHelper = apiHelper;
            _events    = events;
            //_container = container;

            _events.Subscribe(this);

            //ActivateItem(_loginVM);
            //ActivateItem(_container.GetInstance<LoginViewModel>());
            ActivateItem(IoC.Get <LoginViewModel>());
        }
Example #16
0
        public ShellViewModel(SimpleContainer _container, SalesViewModel _salesVM,
                              IEventAggregator _events)
        {
            container = _container;
            salesVM   = _salesVM;

            events = _events;

            // Second step of event handling
            // We subscribe with the current instance of the shell view model
            events.Subscribe(this);

            // Get a new instance of LoginViewModel and activate it (its PerRequest)
            // this way we never have data from the previous state
            base.ActivateItem(container.GetInstance <LoginViewModel>());
        }
Example #17
0
        public ShellViewModel(IEventAggregator events,
                              SalesViewModel salesVM,
                              ILoggedInUserModel user,
                              IAPIHelper apiHelper)
        {
            _events    = events;
            _salesVM   = salesVM;
            _user      = user;
            _apiHelper = apiHelper;

            System.Globalization.CultureInfo.DefaultThreadCurrentUICulture = new System.Globalization.CultureInfo("hu-HU");
            System.Globalization.CultureInfo.DefaultThreadCurrentCulture   = new System.Globalization.CultureInfo("hu-HU");

            System.Globalization.CultureInfo.CurrentUICulture = new System.Globalization.CultureInfo("hu-HU");
            System.Globalization.CultureInfo.CurrentCulture   = new System.Globalization.CultureInfo("hu-HU");

            _events.SubscribeOnPublishedThread(this);

            ActivateItemAsync(IoC.Get <LoginViewModel>(), new CancellationToken());
        }