diff options
| author | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 13:38:18 +0000 |
|---|---|---|
| committer | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 13:38:18 +0000 |
| commit | 1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 (patch) | |
| tree | e1c3b20ea08f0cf71122a1e73f0d395f8fd83874 /Codemerx/Gestor.Application/ViewModels/Generic/DialogViewModel.cs | |
| parent | 674ca83ba9243a9e95a7568c797668dab6aee26a (diff) | |
| download | gestor-1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1.tar.gz gestor-1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1.zip | |
chore: location
Diffstat (limited to 'Codemerx/Gestor.Application/ViewModels/Generic/DialogViewModel.cs')
| -rw-r--r-- | Codemerx/Gestor.Application/ViewModels/Generic/DialogViewModel.cs | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/Codemerx/Gestor.Application/ViewModels/Generic/DialogViewModel.cs b/Codemerx/Gestor.Application/ViewModels/Generic/DialogViewModel.cs new file mode 100644 index 0000000..523b64f --- /dev/null +++ b/Codemerx/Gestor.Application/ViewModels/Generic/DialogViewModel.cs @@ -0,0 +1,87 @@ +using Gestor.Application.Helpers;
+using System;
+using System.ComponentModel;
+using System.Runtime.CompilerServices;
+using System.Threading;
+using System.Windows;
+
+namespace Gestor.Application.ViewModels.Generic
+{
+ public class DialogViewModel : INotifyPropertyChanged
+ {
+ private string _message;
+
+ private string _acceptContent;
+
+ private string _cancelContent;
+
+ private Visibility _cancelVisibility;
+
+ public string AcceptContent
+ {
+ get
+ {
+ return this._acceptContent;
+ }
+ set
+ {
+ this.MutateVerbose<string>(ref this._acceptContent, value, this.RaisePropertyChanged(), "AcceptContent");
+ }
+ }
+
+ public string CancelContent
+ {
+ get
+ {
+ return this._cancelContent;
+ }
+ set
+ {
+ this.CancelVisibility = (string.IsNullOrEmpty(value) ? Visibility.Collapsed : Visibility.Visible);
+ this.MutateVerbose<string>(ref this._cancelContent, value, this.RaisePropertyChanged(), "CancelContent");
+ }
+ }
+
+ public Visibility CancelVisibility
+ {
+ get
+ {
+ return this._cancelVisibility;
+ }
+ set
+ {
+ this.MutateVerbose<Visibility>(ref this._cancelVisibility, value, this.RaisePropertyChanged(), "CancelVisibility");
+ }
+ }
+
+ public string Message
+ {
+ get
+ {
+ return this._message;
+ }
+ set
+ {
+ this.MutateVerbose<string>(ref this._message, value, this.RaisePropertyChanged(), "Message");
+ }
+ }
+
+ public DialogViewModel()
+ {
+ }
+
+ private Action<PropertyChangedEventArgs> RaisePropertyChanged()
+ {
+ return (PropertyChangedEventArgs args) => {
+ PropertyChangedEventHandler propertyChangedEventHandler = this.PropertyChanged;
+ if (propertyChangedEventHandler == null)
+ {
+ return;
+ }
+ propertyChangedEventHandler(this, args);
+ };
+ }
+
+ public event PropertyChangedEventHandler PropertyChanged;
+ }
+}
\ No newline at end of file |