ArtemLibaryTest 1.5.2

dotnet add package ArtemLibaryTest --version 1.5.2
                    
NuGet\Install-Package ArtemLibaryTest -Version 1.5.2
                    
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="ArtemLibaryTest" Version="1.5.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ArtemLibaryTest" Version="1.5.2" />
                    
Directory.Packages.props
<PackageReference Include="ArtemLibaryTest" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ArtemLibaryTest --version 1.5.2
                    
#r "nuget: ArtemLibaryTest, 1.5.2"
                    
#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.
#:package ArtemLibaryTest@1.5.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ArtemLibaryTest&version=1.5.2
                    
Install as a Cake Addin
#tool nuget:?package=ArtemLibaryTest&version=1.5.2
                    
Install as a Cake Tool

ArtemLibaryTest

ArtemLibaryTest — это WPF/.NET библиотека для быстрого запуска типового desktop‑приложения с авторизацией, ролями пользователей, готовыми UI-компонентами и интеграцией с MySQL.

Описание проекта

Библиотека помогает быстро собрать каркас учебного/демо-проекта:

  • авторизация и сессия пользователя;
  • готовые модели и шаблоны для меню/навигации;
  • вспомогательные методы для SQL-фильтрации и работы с DataTable;
  • удобные методы для вывода изображений из пути файла и из BLOB-полей MySQL;
  • quick start-компоненты для окна входа и пользовательских страниц.

Это снижает количество шаблонного кода в WPF-проектах и ускоряет запуск MVP/демо.

Установка

dotnet add package ArtemLibaryTest

Быстрый старт

1) Подключите namespace

using ArtemLibaryTest.Core;
using ArtemLibaryTest.Models;
using ArtemLibaryTest.QuickStart;

2) Настройте подключение к БД

public static class DbConfig
{
    public const string ConnectionString =
        "Server=127.0.0.1;Port=3306;Database=exam_demo;Uid=root;Pwd=;SslMode=None;Protocol=Tcp;";
}

3) Запустите готовое окно авторизации

protected override void OnStartup(StartupEventArgs e)
{
    base.OnStartup(e);

    var authService = new MySqlAuthService(DbConfig.ConnectionString);
    var options = new AuthUiOptions
    {
        AppTitle = "Exam Demo",
        MainWelcomeText = "Готовое главное меню из библиотеки",
        IsSettingsVisible = true,
        MenuProvider = new AppMenuProvider()
    };

    var loginWindow = AuthUiLauncher.CreateLoginWindow(authService, options);
    loginWindow.Show();
}

Примеры использования

Пример 1: Фильтрация SQL через DbHelper

var db = new DbHelper(DbConfig.ConnectionString);
var sql = new StringBuilder(@"
SELECT p.id, p.name, p.price, p.photo
FROM products p
WHERE 1=1");

var parameters = new List<MySqlParameter>();
DbHelper.AddWhereMin(sql, parameters, "p.price", "@min", 100);
DbHelper.AddWhereLikeAnyWord(sql, parameters, "p.name", "@name", "цемент м500");

var table = db.GetTableWithImagePath(sql.ToString(), parameters.ToArray());
ProductsGrid.ItemsSource = table.DefaultView;

Пример 2: Загрузка категорий в ComboBox

var db = new DbHelper(DbConfig.ConnectionString);
db.LoadCategoriesToComboBox(CategoryComboBox);

Пример 3: Вывод BLOB-аватарок из MySQL

var db = new DbHelper(DbConfig.ConnectionString);

UsersGrid.ItemsSource = db.GetTableWithBlobImage(@"
    SELECT id, name, login, phone, email, status, money, img
    FROM users
    ORDER BY id;").DefaultView;

Для DataGrid:

<DataGridTemplateColumn Header="Аватар">
    <DataGridTemplateColumn.CellTemplate>
        <DataTemplate>
            <Image Source="{Binding ImgSource}" Width="48" Height="48" Stretch="UniformToFill" />
        </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible.  net9.0-windows was computed.  net10.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.5.2 96 6/1/2026
1.4.6 100 5/28/2026
1.4.4 93 5/27/2026
1.4.0 90 5/25/2026
1.3.8 91 5/24/2026
1.3.2 87 5/18/2026
1.3.0 94 5/15/2026
1.1.9 101 4/24/2026
1.1.6 101 4/6/2026