public void Hide()
 {
     using (dynamic context = new EvalContext(JsRuntime))
     {
         (context as EvalContext).Expression = () => context.jQuery(Selector).hide();
     }
 }
        //[CascadingParameter]
        //protected EditContext CurrentEditContext { get; set; }

        protected async override Task OnInitializedAsync()
        {
            //todo: allow upload of fitness
            //FitnessTypeNameOptions = Jtc.Optimization.Objects.FitnessTypeNameOptions.Options; assembly.GetTypes().Where(w => w.GetInterfaces().Contains(typeof(IFitness))).Select(s => s.FullName).OrderBy(o => o);

            using (dynamic context = new EvalContext(JSRuntime))
            {
                (context as EvalContext).Expression = () => context.ClientStorage.fetchConfig();
                var json = await(context as EvalContext).InvokeAsync <string>();

                if (!string.IsNullOrEmpty(json))
                {
                    Config = JsonSerializer.Deserialize <Models.OptimizerConfiguration>(json);
                }
            }

            ToggleFitness();

            using (dynamic context = new EvalContext(JSRuntime))
            {
                (context as EvalContext).Expression = () => context.jQuery("body").css("overflow-y", "scroll");
            }

            await base.OnInitializedAsync();
        }
 public async Task Hide()
 {
     using (dynamic context = new EvalContext(JsRuntime))
     {
         (context as EvalContext).Expression = () => context.jQuery("#wait").hide();
         await(context as EvalContext).InvokeAsync <dynamic>();
     }
 }
 protected async override Task OnAfterRenderAsync(bool firstRender)
 {
     if (firstRender)
     {
         using (dynamic context = new EvalContext(JSRuntime))
         {
             (context as EvalContext).Expression = () => context.jQuery("#historicalSelect").val(Column);
         }
         await NewPlot("AveragePrice");
     }
 }
Exemple #5
0
        protected async override Task OnInitializedAsync()
        {
            _activityLogger = new ActivityLogger(() => StateHasChanged(), m => Wait.ShowMessage(m));

            using (dynamic context = new EvalContext(JSRuntime))
            {
                (context as EvalContext).Expression = () => context.jQuery("body").css("overflow-y", "hidden");
            }

            await base.OnInitializedAsync();
        }
        public void Given_a_dynamic_expression_And_a_function_chain_is_called_When_invoked_Then_should_execute_evaluation()
        {
            var runtime = new Mock <IJSRuntime>();

            using (dynamic context = new EvalContext(runtime.Object))
            {
                (context as EvalContext).Expression = () => context.jQuery("body").css("overflow-y", "hidden");
            }

            Verify(runtime, "jQuery(\"body\").css(\"overflow-y\", \"hidden\")");
        }
        protected async override Task OnInitializedAsync()
        {
            Program.HttpClient = HttpClient;
            Program.JsRuntime  = JSRuntime;


            using (dynamic context = new EvalContext(JSRuntime))
            {
                (context as EvalContext).Expression = () => context.jQuery("body").css("overflow-y", "hidden");
            }

            await base.OnInitializedAsync();
        }
        public async Task HistoricalClick()
        {
            if (_controller != "PropertyPrices")
            {
                using (dynamic context = new EvalContext(JSRuntime))
                {
                    (context as EvalContext).Expression = () => context.jQuery("#historicalSelect").val(Column);
                }

                HistoricalClass = "align-middle";
                ForecastClass   = "d-none";
                _controller     = "PropertyPrices";
                await NewPlot(Column);
            }
        }
        public async Task ForecastClick()
        {
            if (_controller != "Forecast")
            {
                if (ForecastColumnOptions.ContainsValue(Column))
                {
                    using (dynamic context = new EvalContext(JSRuntime))
                    {
                        (context as EvalContext).Expression = () => context.jQuery("#forecastSelect").val(Column);
                    }
                }

                HistoricalClass = "d-none";
                ForecastClass   = "align-middle";
                _controller     = "Forecast";
                await NewPlot(Column);
            }
        }