77 instantiations of EditContext
Microsoft.AspNetCore.Components.Forms.Tests (30)
EditContextDataAnnotationsExtensionsTest.cs (7)
24
var editContext = new
EditContext
(new object());
36
var editContext = new
EditContext
(model);
66
var editContext = new
EditContext
(model);
83
var editContext = new
EditContext
(model);
111
var editContext = new
EditContext
(independentTopLevelModel);
151
var editContext = new
EditContext
(new TestModel());
170
var editContext = new
EditContext
(model);
EditContextTest.cs (18)
11
var ex = Assert.Throws<ArgumentNullException>(() => new
EditContext
(null));
19
var editContext = new
EditContext
(model);
28
var editContext = new
EditContext
(model);
39
var editContext = new
EditContext
(new object());
47
var editContext = new
EditContext
(new object());
67
var editContext = new
EditContext
(new object());
89
var editContext = new
EditContext
(new object());
108
var editContext = new
EditContext
(new object());
129
var editContext = new
EditContext
(new object());
159
var editContext = new
EditContext
(new object());
187
var editContext = new
EditContext
(new object());
200
var editContext = new
EditContext
(new object());
217
var editContext = new
EditContext
(new object());
240
var editContext = new
EditContext
(new object());
260
var editContext = new
EditContext
(model);
273
var editContext = new
EditContext
(new object());
297
var editContext = new
EditContext
(new object());
323
var editContext = new
EditContext
(new object());
ValidationMessageStoreTest.cs (5)
18
new ValidationMessageStore(new
EditContext
(new object()));
25
var messages = new ValidationMessageStore(new
EditContext
(new object()));
45
var messages = new ValidationMessageStore(new
EditContext
(new object()));
60
var messages = new ValidationMessageStore(new
EditContext
(new object()));
79
var 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)
35
EditContext = new
EditContext
(new TestModel()),
86
var editContext = new
EditContext
(new TestModel()) { ShouldUseFieldIdentifiers = createFieldPath };
134
var editContext = new
EditContext
(new object());
179
var editContext = new
EditContext
(new object());
Forms\InputBaseTest.cs (21)
16
var rootComponent = new TestInputHostComponent<string, TestInputComponent<string>> { EditContext = new
EditContext
(model), ValueExpression = () => model.StringProperty };
20
rootComponent.EditContext = new
EditContext
(model);
30
var rootComponent = new TestInputHostComponent<string, TestInputComponent<string>> { EditContext = new
EditContext
(model) };
44
EditContext = new
EditContext
(model),
63
EditContext = new
EditContext
(model),
82
EditContext = new
EditContext
(model),
101
EditContext = new
EditContext
(model),
140
EditContext = new
EditContext
(model),
163
EditContext = new
EditContext
(model),
185
EditContext = new
EditContext
(model),
206
EditContext = new
EditContext
(model),
244
EditContext = new
EditContext
(model),
265
EditContext = new
EditContext
(model),
283
EditContext = new
EditContext
(model),
313
EditContext = new
EditContext
(model),
347
EditContext = new
EditContext
(model),
371
EditContext = new
EditContext
(model),
407
EditContext = new
EditContext
(model),
431
var invalidContext = new
EditContext
(model);
464
var invalidContext = new
EditContext
(model);
500
EditContext = new
EditContext
(model),
Forms\InputDateTest.cs (2)
15
EditContext = new
EditContext
(model),
41
EditContext = new
EditContext
(model),
Forms\InputNumberTest.cs (3)
30
EditContext = new
EditContext
(model),
56
EditContext = new
EditContext
(model),
74
EditContext = new
EditContext
(model),
Forms\InputRadioTest.cs (4)
19
EditContext = new
EditContext
(model),
33
EditContext = new
EditContext
(model)
52
EditContext = new
EditContext
(model),
67
EditContext = new
EditContext
(model),
Forms\InputSelectTest.cs (10)
15
EditContext = new
EditContext
(model),
34
EditContext = new
EditContext
(model),
53
EditContext = new
EditContext
(model),
72
EditContext = new
EditContext
(model),
92
EditContext = new
EditContext
(model),
113
EditContext = new
EditContext
(model),
134
EditContext = new
EditContext
(model),
154
EditContext = new
EditContext
(model),
173
EditContext = new
EditContext
(model),
199
EditContext = new
EditContext
(model),
Forms\InputTextAreaTest.cs (1)
15
EditContext = new
EditContext
(model),
Forms\InputTextTest.cs (1)
15
EditContext = new
EditContext
(model),
136 references to EditContext
Aspire.Dashboard (4)
Components\Dialogs\FilterDialog.razor.cs (1)
34
public
EditContext
EditContext { get; private set; } = default!;
Components\Pages\Login.razor.cs (3)
21
public
EditContext
EditContext { get; private set; } = default!;
55
EditContext
.OnValidationRequested += (s, e) => _messageStore.Clear();
56
EditContext
.OnFieldChanged += (s, e) => _messageStore.Clear(e.FieldIdentifier);
BasicTestApp (1)
FormsTest\CustomFieldCssClassProvider.cs (1)
13
public 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
"/>.
12
private
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>
25
public 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>
37
public 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>
47
public static IDisposable EnableDataAnnotationsValidation(this
EditContext
editContext, IServiceProvider serviceProvider)
64
private readonly
EditContext
_editContext;
68
public 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
"/>.
13
private readonly
EditContext
_editContext;
19
/// <param name="editContext">The <see cref="
EditContext
"/> with which this store should be associated.</param>
20
public 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)
16
var
editContext = (
EditContext
)null;
24
var
editContext = new EditContext(new object());
26
var
returnValue = editContext.AddDataAnnotationsValidation();
36
var
editContext = new EditContext(model);
66
var
editContext = new EditContext(model);
83
var
editContext = new EditContext(model);
111
var
editContext = new EditContext(independentTopLevelModel);
151
var
editContext = new EditContext(new TestModel());
170
var
editContext = new EditContext(model);
EditContextTest.cs (17)
19
var
editContext = new EditContext(model);
28
var
editContext = new EditContext(model);
39
var
editContext = new EditContext(new object());
47
var
editContext = new EditContext(new object());
67
var
editContext = new EditContext(new object());
89
var
editContext = new EditContext(new object());
108
var
editContext = new EditContext(new object());
129
var
editContext = new EditContext(new object());
159
var
editContext = new EditContext(new object());
187
var
editContext = new EditContext(new object());
200
var
editContext = new EditContext(new object());
217
var
editContext = new EditContext(new object());
240
var
editContext = new EditContext(new object());
260
var
editContext = new EditContext(model);
273
var
editContext = new EditContext(new object());
297
var
editContext = new EditContext(new object());
323
var
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>
23
public static string FieldCssClass<TField>(this
EditContext
editContext, Expression<Func<TField>> accessor)
29
/// <param name="editContext">The <see cref="
EditContext
"/>.</param>
32
public 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>
47
public static void SetFieldCssClassProvider(this
EditContext
editContext, FieldCssClassProvider fieldCssClassProvider)
Forms\EditForm.cs (9)
17
private
EditContext
? _editContext;
36
/// from the <see cref="
EditContext
.Model"/> property.
39
public
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; }
167
builder.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>
22
public 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
"/>.
67
protected
EditContext
EditContext { get; set; } = default!;
264
$"{nameof(Forms.
EditContext
)} dynamically.");
Forms\Mapping\EditContextFormMappingExtensions.cs (4)
12
public static IDisposable EnableFormMappingContextExtensions(this
EditContext
context, FormMappingContext mappingContext)
22
public static string? GetAttemptedValue(this
EditContext
context, string fieldName)
37
private readonly
EditContext
_editContext;
42
public MappingContextEventSubscriptions(
EditContext
editContext, FormMappingContext mappingContext)
Forms\Mapping\FormMappingValidator.cs (4)
12
private
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
"/>.
14
private
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
"/>.
17
private
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)
44
Assert.StartsWith($"{nameof(EditForm)} requires a {nameof(EditForm.Model)} parameter, or an {nameof(
EditContext
)} parameter, but not both.", ex.Message);
58
Assert.StartsWith($"{nameof(EditForm)} requires either a {nameof(EditForm.Model)} parameter, or an {nameof(
EditContext
)} parameter, please provide one of these.", ex.Message);
73
var
returnedEditContext = editFormComponent.EditContext;
86
var
editContext = new EditContext(new TestModel()) { ShouldUseFieldIdentifiers = createFieldPath };
94
var
returnedEditContext = editFormComponent.EditContext;
124
frame => AssertFrame.Component<CascadingValue<
EditContext
>>(frame, 4),
134
var
editContext = new EditContext(new object());
169
frame => AssertFrame.Component<CascadingValue<
EditContext
>>(frame, 4),
179
var
editContext = new EditContext(new object());
228
public
EditContext
EditContext { get; set; }
234
public Action<
EditContext
> SubmitHandler { get; set; }
265
builder.AddComponentParameter(4, "OnValidSubmit", new EventCallback<
EditContext
>(null, SubmitHandler));
Forms\InputBaseTest.cs (3)
431
var
invalidContext = new EditContext(model);
464
var
invalidContext = new EditContext(model);
556
public new
EditContext
EditContext => base.EditContext;
Forms\InputRadioTest.cs (2)
138
public
EditContext
EditContext { get; set; }
144
builder.OpenComponent<CascadingValue<
EditContext
>>(0);
Forms\TestInputHostComponent.cs (2)
14
public
EditContext
EditContext { get; set; }
24
builder.OpenComponent<CascadingValue<
EditContext
>>(0);