77 instantiations of EditContext
Microsoft.AspNetCore.Components.Forms.Tests (30)
EditContextDataAnnotationsExtensionsTest.cs (7)
24var editContext = new EditContext(new object()); 36var editContext = new EditContext(model); 66var editContext = new EditContext(model); 83var editContext = new EditContext(model); 111var editContext = new EditContext(independentTopLevelModel); 151var editContext = new EditContext(new TestModel()); 170var editContext = new EditContext(model);
EditContextTest.cs (18)
11var ex = Assert.Throws<ArgumentNullException>(() => new EditContext(null)); 19var editContext = new EditContext(model); 28var editContext = new EditContext(model); 39var editContext = new EditContext(new object()); 47var editContext = new EditContext(new object()); 67var editContext = new EditContext(new object()); 89var editContext = new EditContext(new object()); 108var editContext = new EditContext(new object()); 129var editContext = new EditContext(new object()); 159var editContext = new EditContext(new object()); 187var editContext = new EditContext(new object()); 200var editContext = new EditContext(new object()); 217var editContext = new EditContext(new object()); 240var editContext = new EditContext(new object()); 260var editContext = new EditContext(model); 273var editContext = new EditContext(new object()); 297var editContext = new EditContext(new object()); 323var editContext = new EditContext(new object());
ValidationMessageStoreTest.cs (5)
18new ValidationMessageStore(new EditContext(new object())); 25var messages = new ValidationMessageStore(new EditContext(new object())); 45var messages = new ValidationMessageStore(new EditContext(new object())); 60var messages = new ValidationMessageStore(new EditContext(new object())); 79var messages = new ValidationMessageStore(new EditContext(new object()));
Microsoft.AspNetCore.Components.Web (1)
Forms\EditForm.cs (1)
126_editContext = new EditContext(Model!);
Microsoft.AspNetCore.Components.Web.Tests (46)
Forms\EditFormTest.cs (4)
35EditContext = new EditContext(new TestModel()), 86var editContext = new EditContext(new TestModel()) { ShouldUseFieldIdentifiers = createFieldPath }; 134var editContext = new EditContext(new object()); 179var editContext = new EditContext(new object());
Forms\InputBaseTest.cs (21)
16var rootComponent = new TestInputHostComponent<string, TestInputComponent<string>> { EditContext = new EditContext(model), ValueExpression = () => model.StringProperty }; 20rootComponent.EditContext = new EditContext(model); 30var rootComponent = new TestInputHostComponent<string, TestInputComponent<string>> { EditContext = new EditContext(model) }; 44EditContext = new EditContext(model), 63EditContext = new EditContext(model), 82EditContext = new EditContext(model), 101EditContext = new EditContext(model), 140EditContext = new EditContext(model), 163EditContext = new EditContext(model), 185EditContext = new EditContext(model), 206EditContext = new EditContext(model), 244EditContext = new EditContext(model), 265EditContext = new EditContext(model), 283EditContext = new EditContext(model), 313EditContext = new EditContext(model), 347EditContext = new EditContext(model), 371EditContext = new EditContext(model), 407EditContext = new EditContext(model), 431var invalidContext = new EditContext(model); 464var invalidContext = new EditContext(model); 500EditContext = new EditContext(model),
Forms\InputDateTest.cs (2)
15EditContext = new EditContext(model), 41EditContext = new EditContext(model),
Forms\InputNumberTest.cs (3)
30EditContext = new EditContext(model), 56EditContext = new EditContext(model), 74EditContext = new EditContext(model),
Forms\InputRadioTest.cs (4)
19EditContext = new EditContext(model), 33EditContext = new EditContext(model) 52EditContext = new EditContext(model), 67EditContext = new EditContext(model),
Forms\InputSelectTest.cs (10)
15EditContext = new EditContext(model), 34EditContext = new EditContext(model), 53EditContext = new EditContext(model), 72EditContext = new EditContext(model), 92EditContext = new EditContext(model), 113EditContext = new EditContext(model), 134EditContext = new EditContext(model), 154EditContext = new EditContext(model), 173EditContext = new EditContext(model), 199EditContext = new EditContext(model),
Forms\InputTextAreaTest.cs (1)
15EditContext = new EditContext(model),
Forms\InputTextTest.cs (1)
15EditContext = new EditContext(model),
136 references to EditContext
Aspire.Dashboard (4)
Components\Dialogs\FilterDialog.razor.cs (1)
34public EditContext EditContext { get; private set; } = default!;
Components\Pages\Login.razor.cs (3)
21public EditContext EditContext { get; private set; } = default!; 55EditContext.OnValidationRequested += (s, e) => _messageStore.Clear(); 56EditContext.OnFieldChanged += (s, e) => _messageStore.Clear(e.FieldIdentifier);
BasicTestApp (1)
FormsTest\CustomFieldCssClassProvider.cs (1)
13public override string GetFieldCssClass(EditContext editContext, in FieldIdentifier fieldIdentifier)
Microsoft.AspNetCore.Components.Forms (43)
DataAnnotationsValidator.cs (5)
7/// Adds Data Annotations validation support to an <see cref="EditContext"/>. 12private EditContext? _originalEditContext; 14[CascadingParameter] EditContext? CurrentEditContext { get; set; } 24$"parameter of type {nameof(EditContext)}. For example, you can use {nameof(DataAnnotationsValidator)} " + 40$"{nameof(EditContext)} dynamically.");
EditContext.cs (13)
23/// Constructs an instance of <see cref="EditContext"/>. 25/// <param name="model">The model object for the <see cref="EditContext"/>. This object should hold the data being edited, for example as a set of properties.</param> 52/// on this <see cref="EditContext"/>'s <see cref="Model"/>. 55/// <returns>A <see cref="FieldIdentifier"/> corresponding to a specified field name on this <see cref="EditContext"/>'s <see cref="Model"/>.</returns> 60/// Gets the model object for this <see cref="EditContext"/>. 105/// Clears all modification flags within this <see cref="EditContext"/>. 116/// Determines whether any of the fields in this <see cref="EditContext"/> have been modified. 118/// <returns>True if any of the fields in this <see cref="EditContext"/> have been modified; otherwise false.</returns> 182/// Determines whether the specified fields in this <see cref="EditContext"/> has been modified. 191/// Determines whether the specified fields in this <see cref="EditContext"/> has been modified. 199/// Determines whether the specified fields in this <see cref="EditContext"/> has no associated validation messages. 206/// Determines whether the specified fields in this <see cref="EditContext"/> has no associated validation messages. 214/// Validates this <see cref="EditContext"/>.
EditContextDataAnnotationsExtensions.cs (15)
16/// Extension methods to add DataAnnotations validation to an <see cref="EditContext"/>. 21/// Adds DataAnnotations validation support to the <see cref="EditContext"/>. 23/// <param name="editContext">The <see cref="EditContext"/>.</param> 25public static EditContext AddDataAnnotationsValidation(this EditContext editContext) 32/// Enables DataAnnotations validation support for the <see cref="EditContext"/>. 34/// <param name="editContext">The <see cref="EditContext"/>.</param> 35/// <returns>A disposable object whose disposal will remove DataAnnotations validation support from the <see cref="EditContext"/>.</returns> 37public static IDisposable EnableDataAnnotationsValidation(this EditContext editContext) 42/// Enables DataAnnotations validation support for the <see cref="EditContext"/>. 44/// <param name="editContext">The <see cref="EditContext"/>.</param> 46/// <returns>A disposable object whose disposal will remove DataAnnotations validation support from the <see cref="EditContext"/>.</returns> 47public static IDisposable EnableDataAnnotationsValidation(this EditContext editContext, IServiceProvider serviceProvider) 64private readonly EditContext _editContext; 68public DataAnnotationsEventSubscriptions(EditContext editContext, IServiceProvider serviceProvider)
EditContextProperties.cs (1)
9/// Holds arbitrary key/value pairs associated with an <see cref="EditContext"/>.
FieldChangedEventArgs.cs (1)
7/// Provides information about the <see cref="EditContext.OnFieldChanged"/> event.
ValidationMessageStore.cs (6)
9/// Holds validation messages for an <see cref="EditContext"/>. 13private readonly EditContext _editContext; 19/// <param name="editContext">The <see cref="EditContext"/> with which this store should be associated.</param> 20public ValidationMessageStore(EditContext editContext) 60/// To get the validation messages across all validation message stores, use <see cref="EditContext.GetValidationMessages(FieldIdentifier)"/> instead 70/// To get the validation messages across all validation message stores, use <see cref="EditContext.GetValidationMessages(FieldIdentifier)"/> instead
ValidationRequestedEventArgs.cs (1)
7/// Provides information about the <see cref="EditContext.OnValidationRequested"/> event.
ValidationStateChangedEventArgs.cs (1)
7/// Provides information about the <see cref="EditContext.OnValidationStateChanged"/> event.
Microsoft.AspNetCore.Components.Forms.Tests (27)
EditContextDataAnnotationsExtensionsTest.cs (10)
16var editContext = (EditContext)null; 24var editContext = new EditContext(new object()); 26var returnValue = editContext.AddDataAnnotationsValidation(); 36var editContext = new EditContext(model); 66var editContext = new EditContext(model); 83var editContext = new EditContext(model); 111var editContext = new EditContext(independentTopLevelModel); 151var editContext = new EditContext(new TestModel()); 170var editContext = new EditContext(model);
EditContextTest.cs (17)
19var editContext = new EditContext(model); 28var editContext = new EditContext(model); 39var editContext = new EditContext(new object()); 47var editContext = new EditContext(new object()); 67var editContext = new EditContext(new object()); 89var editContext = new EditContext(new object()); 108var editContext = new EditContext(new object()); 129var editContext = new EditContext(new object()); 159var editContext = new EditContext(new object()); 187var editContext = new EditContext(new object()); 200var editContext = new EditContext(new object()); 217var editContext = new EditContext(new object()); 240var editContext = new EditContext(new object()); 260var editContext = new EditContext(model); 273var editContext = new EditContext(new object()); 297var editContext = new EditContext(new object()); 323var editContext = new EditContext(new object());
Microsoft.AspNetCore.Components.Web (42)
Forms\EditContextFieldClassExtensions.cs (9)
9/// Provides extension methods to describe the state of <see cref="EditContext"/> 20/// <param name="editContext">The <see cref="EditContext"/>.</param> 23public static string FieldCssClass<TField>(this EditContext editContext, Expression<Func<TField>> accessor) 29/// <param name="editContext">The <see cref="EditContext"/>.</param> 32public static string FieldCssClass(this EditContext editContext, in FieldIdentifier fieldIdentifier) 42/// Associates the supplied <see cref="FieldCssClassProvider"/> with the supplied <see cref="EditContext"/>. 43/// This customizes the field CSS class names used within the <see cref="EditContext"/>. 45/// <param name="editContext">The <see cref="EditContext"/>.</param> 47public static void SetFieldCssClassProvider(this EditContext editContext, FieldCssClassProvider fieldCssClassProvider)
Forms\EditForm.cs (9)
17private EditContext? _editContext; 36/// from the <see cref="EditContext.Model"/> property. 39public EditContext? EditContext 68[Parameter] public RenderFragment<EditContext>? ChildContent { get; set; } 74/// manually, e.g., by calling <see cref="EditContext.Validate"/>. 76[Parameter] public EventCallback<EditContext> OnSubmit { get; set; } 82[Parameter] public EventCallback<EditContext> OnValidSubmit { get; set; } 88[Parameter] public EventCallback<EditContext> OnInvalidSubmit { get; set; } 167builder.OpenComponent<CascadingValue<EditContext>>(7);
Forms\FieldCssClassProvider.cs (3)
10/// state information from an <see cref="EditContext"/>. 19/// <param name="editContext">The <see cref="EditContext"/>.</param> 22public virtual string GetFieldCssClass(EditContext editContext, in FieldIdentifier fieldIdentifier)
Forms\InputBase.cs (5)
14/// integrates with an <see cref="Forms.EditContext"/>, which must be supplied 29[CascadingParameter] private EditContext? CascadedEditContext { get; set; } 64/// Gets the associated <see cref="Forms.EditContext"/>. 67protected EditContext EditContext { get; set; } = default!; 264$"{nameof(Forms.EditContext)} dynamically.");
Forms\Mapping\EditContextFormMappingExtensions.cs (4)
12public static IDisposable EnableFormMappingContextExtensions(this EditContext context, FormMappingContext mappingContext) 22public static string? GetAttemptedValue(this EditContext context, string fieldName) 37private readonly EditContext _editContext; 42public MappingContextEventSubscriptions(EditContext editContext, FormMappingContext mappingContext)
Forms\Mapping\FormMappingValidator.cs (4)
12private EditContext? _originalEditContext; 14[Parameter] public EditContext? CurrentEditContext { get; set; } 24$"parameter of type {nameof(EditContext)}."); 49$"{nameof(EditContext)} dynamically.");
Forms\ValidationMessage.cs (4)
10/// Displays a list of validation messages for a specified field within a cascaded <see cref="EditContext"/>. 14private EditContext? _previousEditContext; 24[CascadingParameter] EditContext CurrentEditContext { get; set; } = default!; 45$"of type {nameof(EditContext)}. For example, you can use {GetType()} inside " +
Forms\ValidationSummary.cs (4)
13/// Displays a list of validation messages from a cascaded <see cref="EditContext"/>. 17private EditContext? _previousEditContext; 31[CascadingParameter] EditContext CurrentEditContext { get; set; } = default!; 47$"of type {nameof(EditContext)}. For example, you can use {nameof(ValidationSummary)} inside " +
Microsoft.AspNetCore.Components.Web.Tests (19)
Forms\EditFormTest.cs (12)
44Assert.StartsWith($"{nameof(EditForm)} requires a {nameof(EditForm.Model)} parameter, or an {nameof(EditContext)} parameter, but not both.", ex.Message); 58Assert.StartsWith($"{nameof(EditForm)} requires either a {nameof(EditForm.Model)} parameter, or an {nameof(EditContext)} parameter, please provide one of these.", ex.Message); 73var returnedEditContext = editFormComponent.EditContext; 86var editContext = new EditContext(new TestModel()) { ShouldUseFieldIdentifiers = createFieldPath }; 94var returnedEditContext = editFormComponent.EditContext; 124frame => AssertFrame.Component<CascadingValue<EditContext>>(frame, 4), 134var editContext = new EditContext(new object()); 169frame => AssertFrame.Component<CascadingValue<EditContext>>(frame, 4), 179var editContext = new EditContext(new object()); 228public EditContext EditContext { get; set; } 234public Action<EditContext> SubmitHandler { get; set; } 265builder.AddComponentParameter(4, "OnValidSubmit", new EventCallback<EditContext>(null, SubmitHandler));
Forms\InputBaseTest.cs (3)
431var invalidContext = new EditContext(model); 464var invalidContext = new EditContext(model); 556public new EditContext EditContext => base.EditContext;
Forms\InputRadioTest.cs (2)
138public EditContext EditContext { get; set; } 144builder.OpenComponent<CascadingValue<EditContext>>(0);
Forms\TestInputHostComponent.cs (2)
14public EditContext EditContext { get; set; } 24builder.OpenComponent<CascadingValue<EditContext>>(0);