Exemplo n.º 1
0
        public LoginModel(Page page)
        {
            _hostPage = page;

            CommandExecuting = false;

            _loginCommand = new AsyncCommand(async () =>
            {
               await LoginAsync();
            });
        }
        public SuperuserMainPageViewModel(String superuserName)
        {
            _context = CaffeDataContext.Instance;
            var superuser = _context.Superusers.Expand(m => m.Managers).Where(s => s.Login == superuserName).FirstOrDefault();

            if (superuser != null)
            {
                Model = superuser;
            }
            else
            {
                throw new KeyNotFoundException();
            }

            _addManagerCommand = new AsyncCommand(async () => {
                AddManager();
            });
        }