AshrafzyanovMM.Wpf 1.0.3.1

dotnet add package AshrafzyanovMM.Wpf --version 1.0.3.1                
NuGet\Install-Package AshrafzyanovMM.Wpf -Version 1.0.3.1                
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="AshrafzyanovMM.Wpf" Version="1.0.3.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AshrafzyanovMM.Wpf --version 1.0.3.1                
#r "nuget: AshrafzyanovMM.Wpf, 1.0.3.1"                
#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 AshrafzyanovMM.Wpf as a Cake Addin
#addin nuget:?package=AshrafzyanovMM.Wpf&version=1.0.3.1

// Install AshrafzyanovMM.Wpf as a Cake Tool
#tool nuget:?package=AshrafzyanovMM.Wpf&version=1.0.3.1                

LibraryWpf

This project gives you simple AuthWindow, CapchaWindow and ImageEditorWindow window management.

AuthWindow

Namespace: LibraryWpf.Windows

Configurations: ActionConfig and ContextConfig

Namespace of Configuration: LibraryWpf.Configuration

Allow you to manage user access to the app. There is a guest login option.

ActionConfig

Example:

var authConfig = new LibraryWpf.Configuration.ActionConfig(
                authorizeSuccessAction,
                authorizeFailAction,
                authorizeGetUserAction
            ) {
                guestLoginAction = authorizeGuest,
            };

ContextConfig

Generate context: Scaffold-DbContext "Server=ip;Database=database;Trusted_Connection=false;user id=user;password=password" Microsoft.EntityFrameworkCore.SqlServer -ContextDir Context -OutputDir Models -Context DbContext

Replace DbContext in public partial class DbContext : DbContext to LibraryWpf.Misc.AuthContext.

var authContext = new LibraryWpf.Misc.AuthContext("connection string");
var authConfig = new LibraryWpf.Configuration.ContextConfig(
                authorizeSuccessAction,
                authorizeFailAction,
                authContext
            ) {
                guestLoginAction = authorizeGuest,
            };
private void authorizationSuccessAction(LibraryWpf.Interfaces.Models.IUser iUser)
{
    var user = context.Users.Where(user => user.Id == iUser.Id).First();
    MessageBox.Show($"Success login by {user.Name}");
}
private void authorizationFailAction(LibraryWpf.Interfaces.Models.IUser iUser)
{
    if (iUser == null)
    {
         MessageBox.Show("null");
         return;
    }
    var user = iUser as Models.User;
    MessageBox.Show($"Fail login by {user.Name}");
}
Product Compatible and additional computed target framework versions.
.NET net5.0-windows7.0 is compatible.  net6.0-windows was computed.  net7.0-windows 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
1.0.3.1 204 5/25/2023
1.0.3 178 5/24/2023
1.0.2.1 182 5/24/2023
1.0.2 189 5/24/2023
1.0.1.2 183 5/23/2023
1.0.1.1 174 5/23/2023
1.0.1 177 5/22/2023
1.0.0 168 5/22/2023