using with Blazor Desktop #339
-
are there any special considerations for using Blazored.Modal within a Blazor Desktop app? it's not working for me (no errors or apparent changes in the DOM after calling in case it's helpful... setting up app builder: public App()
{
var builder = MobileBlazorBindingsHost.CreateDefaultBuilder()
.ConfigureAppConfiguration(ConfigureConfiguration)
.ConfigureLogging(ConfigureLogging)
.ConfigureServices(ConfigureServices)
.UseWebRoot("wwwroot")
.UseStaticFiles()
; ConfigureServices method (called from above): private void ConfigureServices(HostBuilderContext context, IServiceCollection services)
{
services.AddBlazorHybrid();
// singleton services
services.AddSingleton(new Random());
services.AddBlazoredModal(); index.html: <head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<base href="/"/>
<link href="_content/Blazored.Modal/blazored-modal.css" rel="stylesheet"/>
<link href="_content/DesktopUI/css/main.css" rel="stylesheet"/>
<script src="_content/Blazor.Extensions.Canvas/blazor.extensions.canvas.js"></script>
<script src="_content/Blazored.Modal/blazored.modal.js"></script>
</head> a component: [Inject] private IModalService Modals { get; set; }
...
private void DoConfirmDelete()
{
Modals.Show<ConfirmDeleteDialog>();
} [edit] almost forgot: the main.razor: @using Microsoft.AspNetCore.Components.Routing;
<ContentView>
<StackLayout>
<BlazorWebView VerticalOptions="LayoutOptions.FillAndExpand">
<CascadingBlazoredModal>
<Router AppAssembly="@GetType().Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData"/>
</Found>
<NotFound>
<p>Sorry, there's nothing at this address.</p>
</NotFound>
</Router>
</CascadingBlazoredModal>
</BlazorWebView>
</StackLayout>
</ContentView> |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hi @BenMakesGames, I am afraid I have no experience (yet) with Blazor Desktop. Maybe @chrissainty does, otherwise could you share an (example) project where you see this issue? Then I can open it in Visual Studio and see if I can figure out the issue. |
Beta Was this translation helpful? Give feedback.
-
I'm in the same boat as @larsk2009 here. I've not had any chance to play with Blazor Desktop. |
Beta Was this translation helpful? Give feedback.
I'm in the same boat as @larsk2009 here. I've not had any chance to play with Blazor Desktop.