Fukicycle.Tool.AppBase 8.0.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package Fukicycle.Tool.AppBase --version 8.0.4                
NuGet\Install-Package Fukicycle.Tool.AppBase -Version 8.0.4                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Fukicycle.Tool.AppBase" Version="8.0.4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Fukicycle.Tool.AppBase --version 8.0.4                
#r "nuget: Fukicycle.Tool.AppBase, 8.0.4"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Fukicycle.Tool.AppBase as a Cake Addin
#addin nuget:?package=Fukicycle.Tool.AppBase&version=8.0.4

// Install Fukicycle.Tool.AppBase as a Cake Tool
#tool nuget:?package=Fukicycle.Tool.AppBase&version=8.0.4                

Fukicycle.Tool.AppBase

Nuget

Build and publish packages Build and publish packages Build and publish packages

This library provides blazor app base function. For example, error handling, display loading and display dialog.

Happy coding 😃

Features

  1. Provides application base function.

Installing and Getting started

1. install package.

Fukicycle.Tool.AppBase is available for download and installation as NuGet packages.

dotnet add package Fukicycle.Tool.AppBase --version <version>

2. Create your app.

  1. Add using Fukicycle.Tool.AppBase (_Imports.razor_)

  2. If you use other components, you have to add bellow namespace.

    • Fukicycle.Tool.AppBase.Components
    • Fukicycle.Tool.AppBase.Components.Dialog
    • Fukicycle.Tool.AppBase.Store
  3. Register service. (Program.cs)

     builder.Services.AddAppBase();
    
  4. Change LayoutComponentBase to AppBaseLayoutComponentBase (MainLayout.razor)

     - @inherits LayoutComponentBase
     + @inherits AppBaseLayoutComponentBase
    
     @Body
    
  5. If you want to use default loader and dialog, you have to add bellow. (MainLayout.razor)

     @inherits AppBaseLayoutComponentBase
    
     @Body
    
     @if (StateContainer.IsLoading)
     {
         <Loader /> @/* 👈 You can change your loader component */
     }
     @if (StateContainer.DialogContent != null)
     {
         <Dialog /> @/* 👈 You can change your dialog component */
     }
    
  6. Finally, let each page inherit ViewBase and you're done! 😃

     @page "/"
     @inherits ViewBase
     <h1>Hello, world!</h1>
    
  7. Use Execute or ExecuteAsync to execute code while handling errors.

     @page "/"
     @inherits ViewBase
     <h1>Hello, world!</h1>
     <div>Members</div>
     @if(_members != null)
     {
     	@foreach (string member in _members)
     	{
     		<div>@member</div>
     	}
     }
    
     @if(_skills != null)
     {
     	@foreach (string skill in _skills)
     	{
     		<div>@skill</div>
     	}
     }
     @code {
         private List<string>? _members = null;
         private List<string>? _skills = null;
         protected override async Task OnInitializedAsync()
         {
             //loader
             _skills = await ExecuteAsync(GetSkillsAsync, true);
    
             //no loader
             _members = Execute(GetMembers);
         }
    
         private List<string> GetMembers()
         {
             if (Random.Shared.Next() % 2 == 0) throw new Exception("Something broke!!!");
             return new List<string>
             {
                 "fukicycle",
                 "you",
                 "other"
             };
         }
    
         private async Task<List<string>> GetSkillsAsync()
         {
             await Task.Delay(3000);
             return new List<string>
             {
                 "C#",
                 "Kotlin",
                 "Java",
                 "Blazor"
             };
         }
    
     }
    

Contributing

Pull requests and stars are always welcome. Contributions are what make the open source community such an amazing place to be learn, inspire, and create.
Any contributions you make are greatly appreciated.

  1. Fork the Project.
  2. Create your Feature Branch(git checkout -b feature/amazing_feature).
  3. Commit your Changes(git commit -m 'Add some changes').
  4. Push to the Branch(git push origin feature/amazing_feature).
  5. Open a Pull Request.

Author

License

MIT. Click here for details.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
8.0.5 88 5/10/2024
8.0.4 165 4/16/2024
8.0.3 126 4/15/2024
8.0.2 110 4/11/2024
8.0.1 98 4/11/2024
8.0.0 96 4/10/2024
7.0.5 73 5/10/2024
7.0.4 103 4/16/2024
7.0.3 96 4/15/2024
7.0.2 94 4/11/2024
7.0.1 95 4/11/2024
7.0.0 86 4/10/2024
6.0.5 73 5/10/2024
6.0.4 114 4/16/2024
6.0.3 109 4/15/2024
6.0.2 94 4/11/2024
6.0.1 105 4/11/2024
6.0.0 97 4/10/2024
1.0.3 98 4/10/2024
1.0.2 88 4/9/2024
1.0.1 116 4/9/2024 1.0.1 is deprecated because it is no longer maintained.
1.0.0 124 4/9/2024 1.0.0 is deprecated because it is no longer maintained.