Ejemplo n.º 1
0
        protected override async Task OnInitializedAsync()
        {
            aVTestsData = (await TJBarnesService.GetHttpClient()
                           .GetFromJsonAsync <AVTestData[]>("api/avtests")).ToList();

            BrowserDimensions browserDimensions = await JSRuntime.InvokeAsync <BrowserDimensions>("getDimensions");

            testSpec.BrowserWidth  = browserDimensions.Width;
            testSpec.BrowserHeight = browserDimensions.Height;
            testSpec.DeviceLoad    = Device.DeviceLoad;

            testSpec.SaveLabel = "Save";

            testSpec.DiameterScale  = ScreenSizing.DiameterScaleAV(testSpec.BrowserWidth);
            testSpec.XScale         = ScreenSizing.XScale(testSpec.BrowserWidth);
            testSpec.YScale         = ScreenSizing.YScale(testSpec.BrowserWidth);
            testSpec.BorderWidth    = ScreenSizing.BorderWidthAV(testSpec.BrowserWidth);
            testSpec.FontSize       = ScreenSizing.FontSize(testSpec.BrowserWidth);
            testSpec.FontPaddingTop = ScreenSizing.FontPaddingTop(testSpec.BrowserWidth);
            testSpec.GapMin         = 200;
            testSpec.GapMax         = 1200;

            testSpec.ButtonsCentered = true;
            testSpec.SubmitLabel1    = "Submit";

            screen.XMargin   = ScreenSizing.XMargin(testSpec.BrowserWidth) + 100;
            screen.YMargin   = ScreenSizing.YMargin(testSpec.BrowserWidth) + Convert.ToInt32(testSpec.YScale / 2);
            screen.PlayLabel = "Play";
        }