Пример #1
0
        public App()
        {
            InitializeComponent();
            //DependencyService.Register<HttpClient>();
            //DependencyService.Register<ApiClientProxy>();

            AutofacHelper.Initialize();

            ////TODO remove in future
            //var authService = AutofacHelper.Container.Resolve<AuthService>();
            //var api = AutofacHelper.Container.Resolve<ApiClientProxy>();
            //var response = api.Post("Auth/Login", new Login { UsernameOrEmail = "test", PasswordHash = "P@ssw0rd" });
            //var result = ApiClientProxy.ReadAnswer<ApiResponse<string>>(response);
            //if (result.Code == ApiResponseCode.OK)
            //{
            //    authService.Login(result.Value);
            //    MainPage = new NavigationPage(new ResourceView());
            //}
            //else
            //{
            //    MainPage = new NavigationPage(new MainPage());
            //}

            MainPage = new NavigationPage(new MainPage());
        }