| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- @using Microsoft.AspNetCore.Components.RenderTree
- <div id="test-selector">
- Select test:
- <select bind=@SelectedComponentTypeName>
- <option value="none">Choose...</option>
- <option value="BasicTestApp.InteropComponent">Interop component</option>
- <option value="BasicTestApp.AsyncEventHandlerComponent">Async event handlers</option>
- <option value="BasicTestApp.AddRemoveChildComponents">Add/remove child components</option>
- <option value="BasicTestApp.CounterComponent">Counter</option>
- <option value="BasicTestApp.CounterComponentUsingChild">Counter using child component</option>
- <option value="BasicTestApp.CounterComponentWrapper">Counter wrapped in parent</option>
- <option value="BasicTestApp.FocusEventComponent">Focus events</option>
- <option value="BasicTestApp.KeyPressEventComponent">Key press event</option>
- <option value="BasicTestApp.MouseEventComponent">Mouse events</option>
- <option value="BasicTestApp.TouchEventComponent">Touch events</option>
- <option value="BasicTestApp.InputEventComponent">Input events</option>
- <option value="BasicTestApp.ParentChildComponent">Parent component with child</option>
- <option value="BasicTestApp.PropertiesChangedHandlerParent">Parent component that changes parameters on child</option>
- <option value="BasicTestApp.RedTextComponent">Red text</option>
- <option value="BasicTestApp.RenderFragmentToggler">Render fragment renderer</option>
- <option value="BasicTestApp.TextOnlyComponent">Plain text</option>
- <option value="BasicTestApp.MarkupBlockComponent">Markup blocks</option>
- <option value="BasicTestApp.HierarchicalImportsTest.Subdir.ComponentUsingImports">Imports statement</option>
- <option value="BasicTestApp.HttpClientTest.HttpRequestsComponent">HttpClient tester</option>
- <option value="BasicTestApp.HttpClientTest.BinaryHttpRequestsComponent">Binary HttpClient tester</option>
- <option value="BasicTestApp.HttpClientTest.CookieCounterComponent">HttpClient cookies</option>
- <option value="BasicTestApp.BindCasesComponent">bind cases</option>
- <option value="BasicTestApp.DataDashComponent">data-* attribute rendering</option>
- <option value="BasicTestApp.ExternalContentPackage">External content package</option>
- <option value="BasicTestApp.SvgComponent">SVG</option>
- <option value="BasicTestApp.SvgWithChildComponent">SVG with child component</option>
- <option value="BasicTestApp.LogicalElementInsertionCases">Logical element insertion cases</option>
- <option value="BasicTestApp.ElementRefComponent">Element ref component</option>
- <option value="BasicTestApp.ComponentRefComponent">Component ref component</option>
- <option value="BasicTestApp.AfterRenderInteropComponent">After-render interop component</option>
- <option value="BasicTestApp.EventCasesComponent">Event cases</option>
- <option value="BasicTestApp.EventBubblingComponent">Event bubbling</option>
- <option value="BasicTestApp.EventPreventDefaultComponent">Event preventDefault</option>
- <option value="BasicTestApp.RouterTest.TestRouter">Router</option>
- <option value="BasicTestApp.HtmlBlockChildContent">ChildContent HTML Block</option>
- <option value="BasicTestApp.HtmlMixedChildContent">ChildContent Mixed Block</option>
- <option value="BasicTestApp.HtmlEncodedChildContent">ChildContent HTML Encoded Block</option>
- <option value="BasicTestApp.RazorTemplates">Razor Templates</option>
- <option value="BasicTestApp.MultipleChildContent">Multiple child content</option>
- <option value="BasicTestApp.CascadingValueTest.CascadingValueSupplier">Cascading values</option>
- <option value="BasicTestApp.ConcurrentRenderParent">Concurrent rendering</option>
- <option value="BasicTestApp.DispatchingComponent">Dispatching to sync context</option>
- <option value="BasicTestApp.EventCallbackTest.EventCallbackCases">EventCallback</option>
- <option value="BasicTestApp.FormsTest.SimpleValidationComponent">Simple validation</option>
- <option value="BasicTestApp.FormsTest.TypicalValidationComponent">Typical validation</option>
- <option value="BasicTestApp.FormsTest.NotifyPropertyChangedValidationComponent">INotifyPropertyChanged validation</option>
- </select>
- @if (SelectedComponentType != null)
- {
- <span id="source-info"><code><tt>@(SelectedComponentType.Name.Replace(".", "/")).cshtml</tt></code></span>
- }
- <hr />
- </div>
- <app>
- @((RenderFragment)RenderSelectedComponent)
- </app>
- @functions {
- string SelectedComponentTypeName { get; set; } = "none";
- Type SelectedComponentType
- => SelectedComponentTypeName == "none" ? null : Type.GetType(SelectedComponentTypeName);
- void RenderSelectedComponent(RenderTreeBuilder builder)
- {
- if (SelectedComponentType != null)
- {
- builder.OpenComponent(0, SelectedComponentType);
- builder.CloseComponent();
- }
- }
- }
|