blazor project for cs

This commit is contained in:
Norm Rasmussen
2022-06-13 08:50:32 -04:00
parent 6b46bc3f67
commit 2287bf6dac
949 changed files with 3335 additions and 24761 deletions

View File

@ -1,14 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.5" PrivateAssets="all" />
</ItemGroup>
</Project>

View File

@ -1,29 +0,0 @@
@page "/todo"
<h3>Accounts</h3>
<input @bind="newTodoItem" type = "Enter Item">
<button @onclick="Save"> Save </button>
@if (todoList.Count > 0)
{
<ul style="list-style: none">
@foreach (TodoItem todo in todoList)
{
<li>
<input type="checkbox" @bind="todo.IsComplete" />
<span style = "@(todo.IsComplete ? "text-decoration: line-through" : "")">@todo.Title</span>
</li>
}
</ul>
}
@code {
private List<TodoItem> todoList = new List<TodoItem>();
private string newTodoItem { get; set; }
private void Save()
{
if (!string.IsNullOrWhiteSpace(newTodoItem))
{
todoList.Add(new TodoItem(newTodoItem));
newTodoItem = string.Empty;
}
}
}

View File

@ -1,11 +0,0 @@
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using CS_Todo;
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
await builder.Build().RunAsync();

View File

@ -1,10 +0,0 @@
public class TodoItem
{
public string Title { get; set; }
public bool IsComplete { get; set; } = false;
public TodoItem(string title)
{
Title = title;
}
}

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More