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
<PackageReference Include="AshrafzyanovMM.Wpf" Version="1.0.3.1" />
paket add AshrafzyanovMM.Wpf --version 1.0.3.1
#r "nuget: AshrafzyanovMM.Wpf, 1.0.3.1"
// 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 | Versions 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. |
-
net5.0-windows7.0
- EasyCaptcha.Wpf (>= 0.9.0.3)
- Microsoft.EntityFrameworkCore (>= 5.0.17)
- Microsoft.EntityFrameworkCore.SqlServer (>= 5.0.17)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.