예제 #1
0
        public DocumentsViewModel(INavigationService _navigation, IDatabase _database, ILogging _logging, IDialogue _dialogue,
                                  IDialogue dialogue, IAccountManager _accountManager, IDocumentManager documentManager) : base(_navigation, _database, _logging, _dialogue)
        {
            _dialogue        = dialogue;
            _documentManager = documentManager;

            var SiteUser = _accountManager.GetSiteUser_ByID <Cross.DataVault.Data.Account>(Constants.InMemory_ContactID);

            if (SiteUser != null)
            {
                SiteUserEmail = SiteUser.Email;
                SiteUserName  = String.Format("{0} {1}", SiteUser.FirstName, SiteUser.LastName);
                Avatar        = SiteUser.Avatar;
            }
            else
            {
                throw new ArgumentNullException("Cannot find Site user Information. Please contact site administrator for assistance");
            }

            Initials = String.Format("{0}{1}", SiteUserName.First().ToString().ToUpper(), SiteUserName.Last().ToString().ToLower());
            Title    = "My Documents";

            //Relays
            IOpenDrawer = new Relays.RelayExtension(OpenDrawer, CanOpenDrawer);
            IOpenSearch = new Relays.RelayExtension(OpenSearch, CanOpenSearch);
            IGoBack     = new Relays.RelayExtension(GoBack, CanGoBack);
            IOpenFloat  = new Relays.RelayExtension(OpenFloat, CanOpenFloat);

            //Relays - Refresh Data
            IOnRefresh = new Relays.RelayExtension(OnRefresh, CanOnRefresh);

            //Initialization
            Initialize_Core();
        }
예제 #2
0
        public HomeViewModel(INavigationService _navigation, IDatabase _database,
                             ILogging _logging, IToastNotificator toastNotifier,
                             //Managers
                             IAccountManager _accountManager, INotesManager _notesManager, IPhotoVideoManager _photoVideoManager, IPasswordManager _passwordManager,
                             IContactManager _contactManager, IContactStore _contactStore, IDialogue _dialogue) : base(_navigation, _database, _logging, _dialogue)
        {
            //Managers
            accountManager    = _accountManager;
            notesManager      = _notesManager;
            passwordManager   = _passwordManager;
            photoVideoManager = _photoVideoManager;
            contactManager    = _contactManager;

            contactStore = _contactStore;

            //services
            _toastNotifier = toastNotifier;

            //Navigation Drawer Information
            Title = "Home";

            var SiteUser = _accountManager.GetSiteUser_ByID <Cross.DataVault.Data.Account>(Constants.InMemory_ContactID);

            if (SiteUser != null)
            {
                SiteUserEmail = SiteUser.Email;
                SiteUserName  = String.Format("{0} {1}", SiteUser.FirstName, SiteUser.LastName);
                Avatar        = SiteUser.Avatar;
                Initials      = String.Format("{0}{1}", SiteUserName.First().ToString().ToUpper(), SiteUserName.Last().ToString().ToLower());
            }

            //Relays
            IOpenDrawer = new Relays.RelayExtension(OpenDrawer, CanOpenDrawer);
            IOpenSearch = new Relays.RelayExtension(OpenSearch, CanOpenSearch);

            //Relays - Refresh Data
            IOnRefresh = new Relays.RelayExtension(OnRefresh, CanOnRefresh);

            //Refresh Data
            OnRefresh();

            Initialize_Navigation();
            InitializeCards();
        }