예제 #1
0
        public App(IUserRepository userRepository = null, IServerFinder serverFinder = null)
        {
            _serverFinder = serverFinder;
            _userRepository = userRepository ?? DependencyService.Get<IUserRepository>();

            MainPage = _navigationPage = new NavigationPage();

            if (_userRepository.IsLogged())
            {
                _dashboardPage = new DashboardPage(_userRepository);

                _navigationPage.PushAsync(_dashboardPage);
            }
            else
            {
                var loginPage = new LoginPage(_userRepository);

                loginPage.Login += Login;
                loginPage.Register += Register;

                _navigationPage.PushAsync(loginPage);
            }

        }
예제 #2
0
 public UserRepository(IServerFinder serverFinder = null)
 {
     _serverFinder = serverFinder ?? DependencyService.Get<IServerFinder>();
 }
예제 #3
0
        public RealTimeService(IServerFinder serverFinder = null)
        {
            _serverFinder = serverFinder ?? DependencyService.Get<IServerFinder>();

            Task.Factory.StartNew(OpenConnection);
        }
예제 #4
0
 public ValuesRepository(IServerFinder serverFinder = null, IUserRepository userRepository = null)
 {
     _serverFinder = serverFinder ?? DependencyService.Get<IServerFinder>();
     _userRepository = userRepository ?? DependencyService.Get<IUserRepository>();
 }