3.0 KiB
Raw Permalink Blame History

BackgroundBuilder

.NET WPF XAML C# MVVM DI PostgreSQL Npgsql Dapper Windows

📝 Project description

🖥️ An MVVM WPF application (.NET 8) providing an Excel-like editor for the contatos table in PostgreSQL


📑 Prerequisites

  • .NET
  • PostgreSQL database with table:
  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

  1. ✏️ Edit appsettings.json, set your ConnectionStrings:ContatosDb.

  2. 🖥️ In a terminal:

    dotnet restore
    dotnet build
    dotnet run --project BackgroundBuilder.csproj
    
  3. 🪟 The main window will appear; on load it fetches and displays all contatos.


🏗️ Architecture

  • 🏛️ 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

🚀 Releases

📆 21/05/2025: 🆕 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 WPFs RenderTargetBitmap and PngBitmapEncoder under the hood.