diff --git a/examples/Demo/Shared/Microsoft.FluentUI.AspNetCore.Components.xml b/examples/Demo/Shared/Microsoft.FluentUI.AspNetCore.Components.xml index 88d658e67c..6486ca757c 100644 --- a/examples/Demo/Shared/Microsoft.FluentUI.AspNetCore.Components.xml +++ b/examples/Demo/Shared/Microsoft.FluentUI.AspNetCore.Components.xml @@ -3936,6 +3936,7 @@ left (full height), right (full height) or screen middle (using Width and Height properties). HorizontalAlignment.Stretch is not supported for this property. + NOTE: Left/Right only works for Panels, not Dialogs, which are always centered. @@ -8532,6 +8533,12 @@ If true, the total item count will be updated even if it is the same as the current value. + + + + + + Gets or sets the id of the component the popover is positioned relative to. @@ -8610,19 +8617,26 @@ By default, Escape - - - - + - + + + Closes the popover. Called from JavaScript keyboard navigation. + + + + + Closes the popover and returns focus to the original element (used by the overlay on outside-click). + + + diff --git a/examples/Demo/Shared/Pages/SplashScreen/Examples/DialogSplashScreenCustom.razor b/examples/Demo/Shared/Pages/SplashScreen/Examples/DialogSplashScreenCustom.razor index cab93decbe..f5ae201164 100644 --- a/examples/Demo/Shared/Pages/SplashScreen/Examples/DialogSplashScreenCustom.razor +++ b/examples/Demo/Shared/Pages/SplashScreen/Examples/DialogSplashScreenCustom.razor @@ -1,9 +1,5 @@ @inject IDialogService DialogService - + Open splash screen - - - Open splash screen (async) - \ No newline at end of file diff --git a/examples/Demo/Shared/Pages/SplashScreen/Examples/DialogSplashScreenCustom.razor.cs b/examples/Demo/Shared/Pages/SplashScreen/Examples/DialogSplashScreenCustom.razor.cs index b5f75702cf..226a693b83 100644 --- a/examples/Demo/Shared/Pages/SplashScreen/Examples/DialogSplashScreenCustom.razor.cs +++ b/examples/Demo/Shared/Pages/SplashScreen/Examples/DialogSplashScreenCustom.razor.cs @@ -38,24 +38,6 @@ private async Task OpenSplashCustomAsync() DialogResult result = await _dialog.Result; await HandleCustomSplashAsync(result); } - private void OpenSplashCustom() - { - DemoLogger.WriteLine($"Open custom splashscreen for 4 seconds"); - DialogParameters parameters = new() - { - Content = new() - { - Title = "Water drinking 101", - LoadingText = "Filling the re-useable bottles...", - Message = (MarkupString)"Don't drink too much water!", - Logo = "_content/FluentUI.Demo.Shared/images/Splash_Corporation_logo.png", - }, - Width = "500px", - Height = "300px", - }; - DialogService.ShowSplashScreen(this, HandleCustomSplashAsync, parameters); - } - private async Task HandleCustomSplashAsync(DialogResult result) { await Task.Run(() => DemoLogger.WriteLine($"Custom splash closed")); diff --git a/examples/Demo/Shared/Pages/SplashScreen/Examples/DialogSplashScreenDefault.razor b/examples/Demo/Shared/Pages/SplashScreen/Examples/DialogSplashScreenDefault.razor index bfdf87f890..02764ff2a7 100644 --- a/examples/Demo/Shared/Pages/SplashScreen/Examples/DialogSplashScreenDefault.razor +++ b/examples/Demo/Shared/Pages/SplashScreen/Examples/DialogSplashScreenDefault.razor @@ -1,9 +1,5 @@ @inject IDialogService DialogService - - Open splash screen - - - Open splash screen (async) + Open splash screen diff --git a/examples/Demo/Shared/Pages/SplashScreen/Examples/DialogSplashScreenDefault.razor.cs b/examples/Demo/Shared/Pages/SplashScreen/Examples/DialogSplashScreenDefault.razor.cs index 3ab3eba55b..43f4dba0b0 100644 --- a/examples/Demo/Shared/Pages/SplashScreen/Examples/DialogSplashScreenDefault.razor.cs +++ b/examples/Demo/Shared/Pages/SplashScreen/Examples/DialogSplashScreenDefault.razor.cs @@ -47,26 +47,6 @@ private async Task OpenSplashDefaultAsync() await HandleDefaultSplashAsync(result); } - private void OpenSplashDefault() - { - DemoLogger.WriteLine($"Open default SplashScreen for 4 seconds"); - DialogParameters parameters = new() - { - Content = new() - { - Title = "Core components", - SubTitle = "Microsoft Fluent UI Blazor library", - LoadingText = "Loading...", - Message = (MarkupString)"some extra text here", - Logo = FluentSplashScreen.LOGO, - }, - Width = "640px", - Height = "480px", - Modal = true, - }; - DialogService.ShowSplashScreen(this, HandleDefaultSplashAsync, parameters); - } - private async Task HandleDefaultSplashAsync(DialogResult result) { await Task.Run(() => DemoLogger.WriteLine($"Default splash closed")); diff --git a/examples/Demo/Shared/Pages/SplashScreen/SplashScreenPage.razor b/examples/Demo/Shared/Pages/SplashScreen/SplashScreenPage.razor index 99079342b8..3bc072a16d 100644 --- a/examples/Demo/Shared/Pages/SplashScreen/SplashScreenPage.razor +++ b/examples/Demo/Shared/Pages/SplashScreen/SplashScreenPage.razor @@ -15,17 +15,20 @@ To show a splash screen, the DialogService is used. The DialogService is a singleton service that can be injected into any page/component. It exposes the following methods to show a splash screen dialog:
    -
  • ShowSplashScreen / ShowSplashScreenAsync (uses the FluentSplashScreen to show the dialog)
  • +
  • ShowSplashScreenAsync (uses the FluentSplashScreen to show the dialog)
  • - ShowSplashScreen<T> / ShowSplashScreenAsync<T> where T is a custom component which inherits the FluentSplashScreen component + ShowSplashScreenAsync<T> where T is a custom component which inherits the FluentSplashScreen component and implements IDialogContentComponent<SplashScreenContent> .

- Internally, the ShowSplashScreen methods call the ShowDialog methods. If is possible to directly call these methods and thereby have - access to all of the parameters. The ShowSplashScreen variants are just convenience methods that make ite easier to work with panels. + Internally, the ShowSplashScreenAsync methods call the ShowDialogAsync methods. If is possible to directly call these methods and thereby have + access to all of the parameters. The ShowSplashScreenAsync variants are just convenience methods that make ite easier to work with panels.

+ + The DialogService's synchronous methods are obsoleted and will be removed in the next major version (v5). +

Examples

diff --git a/src/Core/Components/Dialog/Services/DialogService-SplashScreen.cs b/src/Core/Components/Dialog/Services/DialogService-SplashScreen.cs index 58c109ca5a..68969fc16a 100644 --- a/src/Core/Components/Dialog/Services/DialogService-SplashScreen.cs +++ b/src/Core/Components/Dialog/Services/DialogService-SplashScreen.cs @@ -14,6 +14,7 @@ public partial class DialogService /// The component that receives the callback /// Name of the callback function /// that holds the content to display + [Obsolete("Use ShowSplashScreenAsync(object, Func, DialogParameters) instead.")] public void ShowSplashScreen(object receiver, Func callback, DialogParameters parameters) => ShowSplashScreen(receiver, callback, parameters); @@ -23,6 +24,7 @@ public void ShowSplashScreen(object receiver, Func callback, /// The component that receives the callback /// Name of the callback function /// that holds the content to display + [Obsolete("Use ShowSplashScreenAsync(object, Func, DialogParameters) instead.")] public void ShowSplashScreen(object receiver, Func callback, DialogParameters parameters) where T : IDialogContentComponent => ShowSplashScreen(typeof(T), receiver, callback, parameters); @@ -34,6 +36,7 @@ public void ShowSplashScreen(object receiver, Func callba /// The component that receives the callback /// Name of the callback function /// that holds the content to display + [Obsolete("Use ShowSplashScreenAsync(Type, object, Func, DialogParameters) instead.")] public void ShowSplashScreen(Type component, object receiver, Func callback, DialogParameters parameters) { DialogParameters dialogParameters = new() diff --git a/src/Core/Components/Dialog/Services/IDialogService-SplashScreen.cs b/src/Core/Components/Dialog/Services/IDialogService-SplashScreen.cs index a52bf13fa3..9de920d06e 100644 --- a/src/Core/Components/Dialog/Services/IDialogService-SplashScreen.cs +++ b/src/Core/Components/Dialog/Services/IDialogService-SplashScreen.cs @@ -6,11 +6,14 @@ namespace Microsoft.FluentUI.AspNetCore.Components; public partial interface IDialogService { + [Obsolete("Use ShowSplashScreenAsync(object, Func, DialogParameters) instead.")] void ShowSplashScreen(object receiver, Func callback, DialogParameters parameters); + [Obsolete("Use ShowSplashScreenAsync(object, Func, DialogParameters) instead.")] void ShowSplashScreen(object receiver, Func callback, DialogParameters parameters) where T : IDialogContentComponent; + [Obsolete("Use ShowSplashScreenAsync(Type, object, Func, DialogParameters) instead.")] void ShowSplashScreen(Type component, object receiver, Func callback, DialogParameters parameters); Task ShowSplashScreenAsync(object receiver, Func callback, DialogParameters parameters);