Add Blazored.Modal and Blazored.Toast packages.

This commit is contained in:
Unnoen 2022-01-27 18:25:55 +11:00
parent 8b08c7eda7
commit 100b08a1c5
No known key found for this signature in database
GPG Key ID: 8F8E42252BA20553
6 changed files with 31 additions and 16 deletions

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Windows;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
@ -8,6 +8,8 @@ using NLog.Targets;
using Wabbajack.App.Blazor.State;
using Wabbajack.App.Blazor.Utility;
using Wabbajack.Services.OSIntegrated;
using Blazored.Modal;
using Blazored.Toast;
namespace Wabbajack.App.Blazor;
@ -66,6 +68,8 @@ public partial class App
{
services.AddOSIntegrated();
services.AddBlazorWebView();
services.AddBlazoredModal();
services.AddBlazoredToast();
services.AddTransient<MainWindow>();
services.AddSingleton<SystemParametersConstructor>();
services.AddSingleton<IStateContainer, StateContainer>();

View File

@ -1,8 +1,8 @@
<Fluxor.Blazor.Web.StoreInitializer/>
@using Wabbajack.App.Blazor.Shared
<Router AppAssembly="@GetType().Assembly">
<CascadingBlazoredModal>
<Router AppAssembly="@GetType().Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)"/>
</Found>
@ -10,4 +10,5 @@
<h1>Not found</h1>
<p>Sorry, there's nothing here.</p>
</NotFound>
</Router>
</Router>
</CascadingBlazoredModal>

View File

@ -1,7 +1,8 @@
@inherits LayoutComponentBase
@using Blazored.Toast.Configuration
@inherits LayoutComponentBase
@namespace Wabbajack.App.Blazor.Shared
<BlazoredToasts Position="ToastPosition.BottomRight"/>
<div id="background"></div>
<SideBar/>
<div id="wrapper">

View File

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<OutputType>WinExe</OutputType>
@ -14,6 +14,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Blazored.Modal" Version="6.0.1" />
<PackageReference Include="Blazored.Toast" Version="3.2.2" />
<PackageReference Include="DynamicData" Version="7.4.9" />
<PackageReference Include="GitInfo" Version="2.2.0" />
<PackageReference Include="Microsoft-WindowsAPICodePack-Shell" Version="1.1.4" />

View File

@ -6,3 +6,7 @@
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.JSInterop
@using Wabbajack.App.Blazor.Components
@using Blazored.Modal
@using Blazored.Modal.Services
@using Blazored.Toast
@using Blazored.Toast.Services

View File

@ -1,4 +1,4 @@
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<head>
@ -7,6 +7,8 @@
<title>Wabbajack</title>
<base href="/"/>
<link href="Wabbajack.App.Blazor.styles.css" rel="stylesheet" />
<link href="_content/Blazored.Modal/blazored-modal.css" rel="stylesheet" />
<link href="_content/Blazored.Toast/blazored-toast.css" rel="stylesheet" />
</head>
<style>
@ -32,6 +34,7 @@
<div id="app"></div>
<script src="_framework/blazor.webview.js"></script>
<script src="_content/Blazored.Modal/blazored.modal.js"></script>
<script>
async function setImageUsingStreaming(imageElementId, imageStream) {
const arrayBuffer = await imageStream.arrayBuffer();