コード例 #1
0
        public override async void Init(object obj = null)
        {
            await App.Configuration.InitialAsync(this);

            NavigationPage.SetHasNavigationBar(this, false);
            BindingContext = _model;
            _model.WebUri  = await _model.GetLink();

            contentView.Content = new HybridWebView()
            {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand,
                Margin            = new Thickness(0, -6, 0, 0),
                BackgroundColor   = Palette._MainBackground,
                Uri = _model.WebUri + $"?token={App.Configuration.UserToken}"
            };
        }
コード例 #2
0
        public async void Init(object obj = null)
        {
            await App.Configuration.InitialAsync(this);

            NavigationPage.SetHasNavigationBar(this, false);
            BindingContext = _model;

            if (!await _devicePermissionServices.RequestReadStoragePermission())
            {
                _model.SetActivityResource(showError: true,
                                           errorMessage: TextResources.MessagePermissionReadStorageRequired);
                return;
            }

            if (!await _devicePermissionServices.RequestCameraPermission())
            {
                _model.SetActivityResource(showError: true,
                                           errorMessage: TextResources.MessagePermissionCameraRequired);
                return;
            }

            if (!await _devicePermissionServices.RequestWriteStoragePermission())
            {
                _model.SetActivityResource(showError: true,
                                           errorMessage: TextResources.MessagePermissionCameraRequired);
                return;
            }

            _model.WebUri = await _model.GetLink();

            contentView.Content = new HybridChromeWebView()
            {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand,
                Margin            = new Thickness(0, -6, 0, 0),
                BackgroundColor   = Palette._MainBackground,
                Uri = _model.WebUri + $"?token={App.Configuration.UserToken}"
            };
        }