public BaseViewModel(IApiService apiService, ICacheService cacheService, IMessageboxService messageboxService, IProgressDialogService progressDialogService, IPlatformService platformService)
 {
     this.mApiService            = apiService;
     this.mCacheService          = cacheService;
     this.mMessageboxService     = messageboxService;
     this.mProgressDialogService = progressDialogService;
     this.mPlatformService       = platformService;
 }
Example #2
0
        public Sqlite(IUserSettingsService userSettingsService, IMessageboxService messageboxService, IDBCreator creator, IDBUpdater updater)
        {
            m_UserSettingsService = userSettingsService;
            m_MessageboxService   = messageboxService;
            InitLocal(creator, updater);

            m_Creator = creator;
            m_Updater = updater;
        }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        /// <param name="model">
        /// The model
        /// </param>
        /// <param name="windowService">
        /// The window service
        /// </param>
        /// <param name="messageboxService">
        /// The message box service
        /// </param>
        public MainViewModel(object model, IWindowService windowService, IMessageboxService messageboxService)
        {
            this.windowService     = windowService;
            this.messageboxService = messageboxService;
            this.model             = (SampleModel)model;

            //// You may expect this to cause a memory leak, without un-registering, but as the Window is closed the entire View Model is automatically unregistered from the Messenger.
            //// You could, of course use this.MessengerInstance.UnRegister() if you needed to do this prematurely for some reason.
            ////
            //// Note: If this View Model is bound to a view other than a WindowView, cleanup will NOT automatically be called when the window is closed; you will have to make you own arrangements.
            //// Personally, I would recommend that if this VM is embedded in a VM that is bound to a PageView, you let the parent view model handle message registrations and pass the actions onto the
            //// child VM by exposing methods. That way, you leverage the automatic clean up that you get for free, and the reduce the risk of leaving an unexpected message registration behind for the lifetime of the app.
            this.MessengerInstance.Register <ShowTextMessage>(this, m => { this.DemoText = m.Text; });

            this.DemoText = "This text is bound to a property on the view model, when you click the button the view model will change the value using the Set() method. This will automatically call RaisePropertyChanged on the property and cause the UI to update.";
        }
Example #4
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        /// <param name="model">
        /// The model
        /// </param>
        /// <param name="windowService">
        /// The window service
        /// </param>
        /// <param name="messageboxService">
        /// The message box service
        /// </param>
        public MainViewModel(object model, IWindowService windowService, IMessageboxService messageboxService)
        {
            this.windowService = windowService;
            this.messageboxService = messageboxService;
            this.model = (SampleModel)model;

            //// You may expect this to cause a memory leak, without un-registering, but as the Window is closed the entire View Model is automatically unregistered from the Messenger.
            //// You could, of course use this.MessengerInstance.UnRegister() if you needed to do this prematurely for some reason.
            ////
            //// Note: If this View Model is bound to a view other than a WindowView, cleanup will NOT automatically be called when the window is closed; you will have to make you own arrangements.
            //// Personally, I would recommend that if this VM is embedded in a VM that is bound to a PageView, you let the parent view model handle message registrations and pass the actions onto the
            //// child VM by exposing methods. That way, you leverage the automatic clean up that you get for free, and the reduce the risk of leaving an unexpected message registration behind for the lifetime of the app.
            this.MessengerInstance.Register<ShowTextMessage>(this, m => { this.DemoText = m.Text; });

            this.DemoText = "This text is bound to a property on the view model, when you click the button the view model will change the value using the Set() method. This will automatically call RaisePropertyChanged on the property and cause the UI to update.";
        }
Example #5
0
 public AlertDetailViewModel(IApiService apiService, ICacheService cacheService, IMessageboxService messageboxService, IProgressDialogService progressDialogService, IPlatformService platformService)
     : base(apiService, cacheService, messageboxService, progressDialogService, platformService)
 {
 }
Example #6
0
 public CreateCompanyProfileViewModel(IApiService apiService, ICacheService cacheService, IMessageboxService messageboxService, IProgressDialogService progressDialogService, IPlatformService platformService)
     : base(apiService, cacheService, messageboxService, progressDialogService, platformService)
 {
 }
 public DescriptionProjectViewModel(IApiService apiService, ICacheService cacheService, IMessageboxService messageboxService, IProgressDialogService progressDialogService, IPlatformService platformService)
     : base(apiService, cacheService, messageboxService, progressDialogService, platformService)
 {
 }
Example #8
0
 public ProfileViewModel(IApiService apiService, ICacheService cacheService, IMessageboxService messageboxService, IProgressDialogService progressDialogService, IPlatformService platformService)
     : base(apiService, cacheService, messageboxService, progressDialogService, platformService)
 {
     RegisterMessengers();
 }