1.3 KiB
1.3 KiB
BackgroundBuilder
An MVVM WPF application (.NET 6) providing an Excel-like editor for the contatos table in PostgreSQL.
Prerequisites
-
.NET 6 SDK
-
PostgreSQL database with table:
```sql CREATE TABLE public.contatos ( ramal text PRIMARY KEY NOT NULL, nome text NOT NULL, email text, area text, aniversario date, "isComando" boolean NOT NULL ); ```
Setup
- Edit appsettings.json, set your ConnectionStrings:ContatosDb.
- In a terminal:
dotnet restore dotnet build dotnet run --project BackgroundBuilder.csproj - The main window will appear; on load it fetches and displays all contatos.
Architecture
- MVVM with MVVM with ObservableObject, RelayCommand.
- DI via Microsoft.Extensions.Hosting.
- Repositories (PostgresContatoRepository) handle all DB I/O with Dapper.
- Services (DatabaseService) manage the Npgsql connection.
- ViewModels free of data-access logic: only orchestration.
New Background & Export Features
-
Select Background…
Opens a file picker—choose any image (PNG, JPG, BMP). That image becomes your canvas. -
Create Image…
Saves the current DataGrid overlaid on the background as a single PNG.
Uses WPF’sRenderTargetBitmapandPngBitmapEncoderunder the hood.