26 instantiations of PersistentComponentState
Microsoft.AspNetCore.Components (1)
PersistentState\ComponentStatePersistenceManager.cs (1)
27State = new PersistentComponentState(_currentState, _registeredCallbacks);
Microsoft.AspNetCore.Components.Tests (25)
IPersistentComponentStateSerializerTests.cs (3)
19var state = new PersistentComponentState(currentState, []); 34var newState = new PersistentComponentState(new Dictionary<string, byte[]>(), []); 50var state = new PersistentComponentState(new Dictionary<string, byte[]>(), []);
PersistentState\ComponentApplicationStateTest.cs (10)
14var applicationState = new PersistentComponentState(new Dictionary<string, byte[]>(), []); 32var applicationState = new PersistentComponentState(new Dictionary<string, byte[]>(), []); 49var applicationState = new PersistentComponentState(currentState, []) 62var applicationState = new PersistentComponentState(new Dictionary<string, byte[]>(), []); 82var applicationState = new PersistentComponentState(currentState, []) 101var applicationState = new PersistentComponentState(currentState, []) 118var applicationState = new PersistentComponentState(currentState, []) 137var applicationState = new PersistentComponentState(currentState, []) 157var applicationState = new PersistentComponentState(new Dictionary<string, byte[]>(), []); 175var applicationState = new PersistentComponentState(new Dictionary<string, byte[]>(), []);
PersistentState\PersistentServicesRegistryTest.cs (1)
37var componentState = new PersistentComponentState(testStore.State, []);
PersistentStateValueProviderTests.cs (11)
24var state = new PersistentComponentState( 53var state = new PersistentComponentState( 75var state = new PersistentComponentState( 124var newState = new PersistentComponentState(new Dictionary<string, byte[]>(), []); 162var newState = new PersistentComponentState(new Dictionary<string, byte[]>(), []); 203var newState = new PersistentComponentState(new Dictionary<string, byte[]>(), []); 276var newState = new PersistentComponentState(new Dictionary<string, byte[]>(), []); 462var newState = new PersistentComponentState(new Dictionary<string, byte[]>(), []); 497var newState = new PersistentComponentState(new Dictionary<string, byte[]>(), []); 532var newState = new PersistentComponentState(new Dictionary<string, byte[]>(), []); 567var newState = new PersistentComponentState(new Dictionary<string, byte[]>(), []);
64 references to PersistentComponentState
BasicTestApp (2)
PreserveStateService.cs (2)
11private readonly PersistentComponentState _componentApplicationState; 16public PreserveStateService(PersistentComponentState componentApplicationState)
Microsoft.AspNetCore.Components (12)
PersistentComponentState.cs (2)
139/// and removed from the <see cref="PersistentComponentState"/>. 183/// and removed from the <see cref="PersistentComponentState"/>.
PersistentState\ComponentStatePersistenceManager.cs (1)
50public PersistentComponentState State { get; }
PersistentState\PersistentServicesRegistry.cs (5)
41internal void RegisterForPersistence(PersistentComponentState state) 81private static void PersistInstanceState(object instance, Type type, PersistentComponentState state) 99internal void Restore(PersistentComponentState state) 110private void RestoreRegistrationsIfAvailable(PersistentComponentState state) 129private static void RestoreInstanceState(object instance, Type type, PersistentComponentState state)
PersistentStateProviderServiceCollectionExtensions.cs (2)
10/// Enables component parameters to be supplied from <see cref="PersistentComponentState"/> with <see cref="PersistentStateAttribute"/>. 15/// Enables component parameters to be supplied from <see cref="PersistentComponentState"/> with <see cref="PersistentStateAttribute"/>.
PersistentStateValueProvider.cs (2)
18internal sealed class PersistentStateValueProvider(PersistentComponentState state, IServiceProvider serviceProvider) : ICascadingValueSupplier 344/// and removed from the <see cref="PersistentComponentState"/>.
Microsoft.AspNetCore.Components.Endpoints.Tests (13)
EndpointHtmlRendererTest.cs (12)
1415var state = httpContext.RequestServices.GetRequiredService<PersistentComponentState>(); 1469var state = httpContext.RequestServices.GetRequiredService<PersistentComponentState>(); 1507var state = httpContext.RequestServices.GetRequiredService<PersistentComponentState>(); 1537var state = httpContext.RequestServices.GetRequiredService<PersistentComponentState>(); 1602var state = httpContext.RequestServices.GetRequiredService<PersistentComponentState>(); 1746[Inject] public PersistentComponentState State { get; set; } 1857services.AddSingleton<PersistentComponentState>(sp => sp.GetRequiredService<ComponentStatePersistenceManager>().State);
RazorComponentResultTest.cs (1)
467.AddSingleton<PersistentComponentState>(sp => sp.GetRequiredService<ComponentStatePersistenceManager>().State)
Microsoft.AspNetCore.Components.Tests (26)
IPersistentComponentStateSerializerTests.cs (3)
19var state = new PersistentComponentState(currentState, []); 34var newState = new PersistentComponentState(new Dictionary<string, byte[]>(), []); 50var state = new PersistentComponentState(new Dictionary<string, byte[]>(), []);
PersistentState\ComponentApplicationStateTest.cs (10)
14var applicationState = new PersistentComponentState(new Dictionary<string, byte[]>(), []); 32var applicationState = new PersistentComponentState(new Dictionary<string, byte[]>(), []); 49var applicationState = new PersistentComponentState(currentState, []) 62var applicationState = new PersistentComponentState(new Dictionary<string, byte[]>(), []); 82var applicationState = new PersistentComponentState(currentState, []) 101var applicationState = new PersistentComponentState(currentState, []) 118var applicationState = new PersistentComponentState(currentState, []) 137var applicationState = new PersistentComponentState(currentState, []) 157var applicationState = new PersistentComponentState(new Dictionary<string, byte[]>(), []); 175var applicationState = new PersistentComponentState(new Dictionary<string, byte[]>(), []);
PersistentState\PersistentServicesRegistryTest.cs (1)
37var componentState = new PersistentComponentState(testStore.State, []);
PersistentStateValueProviderTests.cs (12)
24var state = new PersistentComponentState( 53var state = new PersistentComponentState( 75var state = new PersistentComponentState( 124var newState = new PersistentComponentState(new Dictionary<string, byte[]>(), []); 162var newState = new PersistentComponentState(new Dictionary<string, byte[]>(), []); 203var newState = new PersistentComponentState(new Dictionary<string, byte[]>(), []); 276var newState = new PersistentComponentState(new Dictionary<string, byte[]>(), []); 462var newState = new PersistentComponentState(new Dictionary<string, byte[]>(), []); 497var newState = new PersistentComponentState(new Dictionary<string, byte[]>(), []); 532var newState = new PersistentComponentState(new Dictionary<string, byte[]>(), []); 567var newState = new PersistentComponentState(new Dictionary<string, byte[]>(), []); 575private static void InitializeState(PersistentComponentState state, List<(ComponentState componentState, string propertyName, string value)> items)
Microsoft.AspNetCore.Components.WebAssembly.Server (7)
AuthenticationStateSerializationOptions.cs (2)
12/// to the WebAssembly client using <see cref="PersistentComponentState"/>. 32/// for JSON serialization to the client using <see cref="PersistentComponentState"/>."/>
AuthenticationStateSerializer.cs (4)
15private readonly PersistentComponentState _state; 21public AuthenticationStateSerializer(PersistentComponentState persistentComponentState, IOptions<AuthenticationStateSerializationOptions> options) 32throw new InvalidOperationException($"{nameof(SetAuthenticationState)} must be called before the {nameof(PersistentComponentState)}.{nameof(PersistentComponentState.RegisterOnPersisting)} callback.");
WebAssemblyRazorComponentsBuilderExtensions.cs (1)
34/// Serializes the <see cref="AuthenticationState"/> returned by the server-side <see cref="AuthenticationStateProvider"/> using <see cref="PersistentComponentState"/>
Microsoft.AspNetCore.Components.WebView (1)
ComponentsWebViewServiceCollectionExtensions.cs (1)
33services.TryAddScoped<PersistentComponentState>(sp => sp.GetRequiredService<ComponentStatePersistenceManager>().State);
Microsoft.AspNetCore.Components.WebView.Test (3)
ComponentsWebViewServiceCollectionExtensionsTests.cs (3)
24var persistentState = serviceProvider.GetService<PersistentComponentState>(); 42var persistentStateDescriptor = services.FirstOrDefault(s => s.ServiceType == typeof(PersistentComponentState));