From 1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 Mon Sep 17 00:00:00 2001 From: Lucas Faria Mendes Date: Mon, 30 Mar 2026 10:38:18 -0300 Subject: chore: location --- .../ViewModels/Generic/DialogAnexarViewModel.cs | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Codemerx/Gestor.Application/ViewModels/Generic/DialogAnexarViewModel.cs (limited to 'Codemerx/Gestor.Application/ViewModels/Generic/DialogAnexarViewModel.cs') diff --git a/Codemerx/Gestor.Application/ViewModels/Generic/DialogAnexarViewModel.cs b/Codemerx/Gestor.Application/ViewModels/Generic/DialogAnexarViewModel.cs new file mode 100644 index 0000000..0e87f86 --- /dev/null +++ b/Codemerx/Gestor.Application/ViewModels/Generic/DialogAnexarViewModel.cs @@ -0,0 +1,44 @@ +using Gestor.Model.Domain.Common; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Gestor.Application.ViewModels.Generic +{ + public class DialogAnexarViewModel : BaseViewModel + { + private ObservableCollection _arquivos = new ObservableCollection(); + + public ObservableCollection Arquivos + { + get + { + return this._arquivos; + } + set + { + this._arquivos = value; + base.OnPropertyChanged("Arquivos"); + } + } + + public DialogAnexarViewModel(List arquivos) + { + this.Arquivos = new ObservableCollection(arquivos); + } + + public void Remover(ArquivoDigital removido) + { + IEnumerable arquivoDigitals = this.Arquivos.Where((ArquivoDigital x) => { + if (x.get_Descricao() != removido.get_Descricao()) + { + return false; + } + return (int)x.get_Arquivo().Length == (int)removido.get_Arquivo().Length; + }); + this.Arquivos = new ObservableCollection(arquivoDigitals); + } + } +} \ No newline at end of file -- cgit v1.2.3