Initial commit
This commit is contained in:
17
src/SharpIDE.Photino/App.razor
Normal file
17
src/SharpIDE.Photino/App.razor
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
<Router AppAssembly="@typeof(Program).Assembly">
|
||||
<Found Context="routeData">
|
||||
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)"/>
|
||||
</Found>
|
||||
<NotFound>
|
||||
<PageTitle>Not found</PageTitle>
|
||||
<LayoutView Layout="@typeof(MainLayout)">
|
||||
<p role="alert">Sorry, there's nothing at this address.</p>
|
||||
</LayoutView>
|
||||
</NotFound>
|
||||
</Router>
|
||||
|
||||
@code
|
||||
{
|
||||
|
||||
}
|
||||
15
src/SharpIDE.Photino/AppThemeProvider.cs
Normal file
15
src/SharpIDE.Photino/AppThemeProvider.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using MudBlazor;
|
||||
|
||||
namespace SharpIDE.Photino;
|
||||
|
||||
public static class AppThemeProvider
|
||||
{
|
||||
public static MudTheme GetTheme()
|
||||
{
|
||||
var theme = new MudTheme();
|
||||
theme.Typography.H5.FontSize = "1.4rem";
|
||||
theme.Typography.H5.FontWeight = "500";
|
||||
theme.Typography.H6.FontSize = "1.1rem";
|
||||
return theme;
|
||||
}
|
||||
}
|
||||
34
src/SharpIDE.Photino/Layout/MainLayout.razor
Normal file
34
src/SharpIDE.Photino/Layout/MainLayout.razor
Normal file
@@ -0,0 +1,34 @@
|
||||
@inherits LayoutComponentBase
|
||||
|
||||
<MudThemeProvider Theme="@AppThemeProvider.GetTheme()" />
|
||||
<MudPopoverProvider/>
|
||||
<MudDialogProvider/>
|
||||
<MudSnackbarProvider/>
|
||||
|
||||
<MudLayout>
|
||||
<MudAppBar Dense="true">
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Menu" Color="Color.Inherit" Edge="Edge.Start" OnClick="@((e) => DrawerToggle())" />
|
||||
</MudAppBar>
|
||||
<MudDrawer @bind-Open="@_drawerOpen">
|
||||
<MudDrawerHeader>
|
||||
<MudStack Row="false" Justify="Justify.Center">
|
||||
<MudText Typo="Typo.h5">SharpIDE.Photino</MudText>
|
||||
</MudStack>
|
||||
</MudDrawerHeader>
|
||||
<NavMenu/>
|
||||
</MudDrawer>
|
||||
<MudMainContent>
|
||||
<MudContainer Class="px-8 py-6">
|
||||
@Body
|
||||
</MudContainer>
|
||||
</MudMainContent>
|
||||
</MudLayout>
|
||||
|
||||
@code {
|
||||
bool _drawerOpen = true;
|
||||
|
||||
void DrawerToggle()
|
||||
{
|
||||
_drawerOpen = !_drawerOpen;
|
||||
}
|
||||
}
|
||||
3
src/SharpIDE.Photino/Layout/NavMenu.razor
Normal file
3
src/SharpIDE.Photino/Layout/NavMenu.razor
Normal file
@@ -0,0 +1,3 @@
|
||||
<MudNavMenu>
|
||||
<MudNavLink Href="/" Icon="@Icons.Material.Filled.Home" Match="NavLinkMatch.All">Home</MudNavLink>
|
||||
</MudNavMenu>
|
||||
7
src/SharpIDE.Photino/Pages/Home.razor
Normal file
7
src/SharpIDE.Photino/Pages/Home.razor
Normal file
@@ -0,0 +1,7 @@
|
||||
@page "/"
|
||||
|
||||
<MudText>Welcome to a new Photino Blazor app!</MudText>
|
||||
|
||||
@code {
|
||||
|
||||
}
|
||||
36
src/SharpIDE.Photino/Program.cs
Normal file
36
src/SharpIDE.Photino/Program.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using MudBlazor.Services;
|
||||
using Photino.Blazor;
|
||||
|
||||
namespace SharpIDE.Photino;
|
||||
|
||||
public class Program
|
||||
{
|
||||
[STAThread]
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
var appBuilder = PhotinoBlazorAppBuilder.CreateDefault(args);
|
||||
|
||||
appBuilder.Services.AddLogging();
|
||||
appBuilder.Services.AddMudServices();
|
||||
|
||||
appBuilder.RootComponents.Add<App>("app");
|
||||
|
||||
var app = appBuilder.Build();
|
||||
|
||||
app.MainWindow
|
||||
.SetSize(1400, 800)
|
||||
.SetDevToolsEnabled(true)
|
||||
.SetLogVerbosity(0)
|
||||
//.SetIconFile("favicon.ico")
|
||||
.SetTitle("SharpIDE.Photino");
|
||||
|
||||
AppDomain.CurrentDomain.UnhandledException += (sender, error) =>
|
||||
{
|
||||
app.MainWindow.ShowMessage("Fatal exception", error.ExceptionObject.ToString());
|
||||
};
|
||||
|
||||
app.Run();
|
||||
}
|
||||
}
|
||||
|
||||
22
src/SharpIDE.Photino/Properties/launchSettings.json
Normal file
22
src/SharpIDE.Photino/Properties/launchSettings.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/launchsettings.json",
|
||||
"profiles": {
|
||||
"Run": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"environmentVariables": {
|
||||
"DOTNET_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"(Watch)": {
|
||||
"commandName": "Executable",
|
||||
"executablePath": "dotnet",
|
||||
"workingDirectory": "$(ProjectDir)",
|
||||
"commandLineArgs": "watch run",
|
||||
"environmentVariables": {
|
||||
"DOTNET_ENVIRONMENT": "Development",
|
||||
"DOTNET_WATCH_RESTART_ON_RUDE_EDIT": "true"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
38
src/SharpIDE.Photino/SharpIDE.Photino.csproj
Normal file
38
src/SharpIDE.Photino/SharpIDE.Photino.csproj
Normal file
@@ -0,0 +1,38 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType> <!-- Doesn't actually mean Windows Exe, 'Exe' = console entrypoint, 'WinExe' = application entry point -->
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<ApplicationIcon>favicon.ico</ApplicationIcon>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<SelfContained>false</SelfContained>
|
||||
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<SupportedPlatform Include="browser" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebView" Version="9.0.0" />
|
||||
<PackageReference Include="MudBlazor" Version="8.0.0-preview.5" />
|
||||
<PackageReference Include="Photino.Blazor" Version="3.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Update="wwwroot\**">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="favicon.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
11
src/SharpIDE.Photino/_Imports.razor
Normal file
11
src/SharpIDE.Photino/_Imports.razor
Normal file
@@ -0,0 +1,11 @@
|
||||
@using System.Net.Http
|
||||
@using System.Net.Http.Json
|
||||
@using Microsoft.AspNetCore.Authorization
|
||||
@using Microsoft.AspNetCore.Components.Forms
|
||||
@using Microsoft.AspNetCore.Components.Routing
|
||||
@using Microsoft.AspNetCore.Components.Web
|
||||
@using Microsoft.AspNetCore.Components.Web.Virtualization
|
||||
@using Microsoft.JSInterop
|
||||
@using Microsoft.Extensions.Logging
|
||||
@using MudBlazor
|
||||
@using SharpIDE.Photino.Layout
|
||||
BIN
src/SharpIDE.Photino/favicon.ico
Normal file
BIN
src/SharpIDE.Photino/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 179 KiB |
1
src/SharpIDE.Photino/wwwroot/css/app.css
Normal file
1
src/SharpIDE.Photino/wwwroot/css/app.css
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
24
src/SharpIDE.Photino/wwwroot/index.html
Normal file
24
src/SharpIDE.Photino/wwwroot/index.html
Normal file
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<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="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet" />
|
||||
<link href="_content/MudBlazor/MudBlazor.min.css" rel="stylesheet" />
|
||||
<link href="css/app.css" rel="stylesheet" />
|
||||
<link href="SharpIDE.Photino.styles.css" rel="stylesheet" />
|
||||
</head>
|
||||
<body>
|
||||
<app>Loading...</app>
|
||||
|
||||
<div id="blazor-error-ui">
|
||||
An unhandled error has occurred.
|
||||
<a href="" class="reload">Reload</a>
|
||||
<a class="dismiss">🗙</a>
|
||||
</div>
|
||||
|
||||
<script src="_framework/blazor.webview.js"></script>
|
||||
<script src="_content/MudBlazor/MudBlazor.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user