Adicionada funcionalidade para importar contatos de arquivos Excel usando a biblioteca ClosedXML, incluindo o comando `ImportExcelCommand` e o método `ImportExcelAsync` na classe `MainWindowViewModel`. Ajustado o layout da interface gráfica para incluir um botão "Importar". Outras alterações incluem: - Adição de pacotes ao projeto (`ClosedXML`, `Dapper`, etc.). - Ajustes no cálculo de `gridWidth` e `gridHeight` em `ImageService`. - Alteração do valor da constante `OverlayOffset` em `ImageService`. - Refatoração do método `SaveBitmap` para tratamento de exceções. - Correção na substituição de extensão ao salvar imagens. - Reorganização de inicialização de coleções em `MainWindowViewModel`. Essas mudanças melhoram a funcionalidade e a consistência do projeto.
BackgroundBuilder
📝 Project description
🖥️ An MVVM WPF application (.NET 8) providing an Excel-like editor for the
contatostable in PostgreSQL
📑 Prerequisites
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 yourConnectionStrings: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
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 WPF’sRenderTargetBitmapandPngBitmapEncoderunder the hood.
Description
Languages
C#
100%