static CascadingValue <T> CreateCascadingValueComponent <T>(T value, string name = null)
        {
            var supplier = new CascadingValue <T>();

            supplier.Configure(new RenderHandle(new TestRenderer(), 0));

            var supplierParams = new Dictionary <string, object>
            {
                { "Value", value }
            };

            if (name != null)
            {
                supplierParams.Add("Name", name);
            }

            supplier.SetParameters(supplierParams);
            return(supplier);
        }
예제 #2
0
        static CascadingValue <T> CreateCascadingValueComponent <T>(T value, string name = null)
        {
            var supplier = new CascadingValue <T>();
            var renderer = new TestRenderer();

            supplier.Configure(new RenderHandle(renderer, 0));

            var supplierParams = new Dictionary <string, object>
            {
                { "Value", value }
            };

            if (name != null)
            {
                supplierParams.Add("Name", name);
            }

            renderer.Dispatcher.InvokeAsync((Action)(() => supplier.SetParametersAsync(ParameterCollection.FromDictionary(supplierParams))));
            return(supplier);
        }