Dreamine.UI.Wpf.Equipment 1.0.1
Dreamine.UI.Wpf.Equipment 사용자 인터페이스 기능과 구성 요소를 제공합니다.
로딩중...
검색중...
일치하는것 없음
DreamineBlinkPopupWindowViewModel.cs
이 파일의 문서화 페이지로 가기
1using System.Windows.Input;
2using System.Windows.Media;
3using Dreamine.MVVM.ViewModels;
4
6
7using Dreamine.UI.Abstractions.Popup;
8
17public sealed class DreamineBlinkPopupWindowViewModel : ViewModelBase
18{
27 private string? _title;
36 public string? Title { get => _title; set => SetProperty(ref _title, value); }
37
46 private string? _message;
55 public string? Message { get => _message; set => SetProperty(ref _message, value); }
56
65 private object? _content;
74 public object? Content { get => _content; set => SetProperty(ref _content, value); }
75
84 private string? _okText;
93 public string? OkText
94 {
95 get => _okText;
96 set
97 {
98 if (SetProperty(ref _okText, value))
99 {
100 OnPropertyChanged(nameof(OkVisible));
101 ((RelayCommand)OkCommand).RaiseCanExecuteChanged();
102 }
103 }
104 }
105
114 private string? _cancelText;
123 public string? CancelText
124 {
125 get => _cancelText;
126 set
127 {
128 if (SetProperty(ref _cancelText, value))
129 {
130 OnPropertyChanged(nameof(CancelVisible));
131 ((RelayCommand)CancelCommand).RaiseCanExecuteChanged();
132 }
133 }
134 }
135
144 public bool IsModal { get; }
145
154 private bool _topMost;
163 public bool TopMost { get => _topMost; set => SetProperty(ref _topMost, value); }
164
173 private bool _fullscreen;
182 public bool Fullscreen { get => _fullscreen; set => SetProperty(ref _fullscreen, value); }
183
192 private bool _useBlink;
201 public bool UseBlink { get => _useBlink; set => SetProperty(ref _useBlink, value); }
202
211 private bool _useContentCard;
220 public bool UseContentCard { get => _useContentCard; set => SetProperty(ref _useContentCard, value); }
221
230 private Color _rootColor1;
239 public Color RootColor1 { get => _rootColor1; set => SetProperty(ref _rootColor1, value); }
240
249 private Color _rootColor2;
258 public Color RootColor2 { get => _rootColor2; set => SetProperty(ref _rootColor2, value); }
259
268 private Color _foregroundColor;
277 public Color ForegroundColor { get => _foregroundColor; set => SetProperty(ref _foregroundColor, value); }
278
287 private double _opacity1;
296 public double Opacity1 { get => _opacity1; set => SetProperty(ref _opacity1, value); }
297
306 private double _opacity2;
315 public double Opacity2 { get => _opacity2; set => SetProperty(ref _opacity2, value); }
316
325 private int _blinkIntervalMs;
334 public int BlinkIntervalMs { get => _blinkIntervalMs; set => SetProperty(ref _blinkIntervalMs, value); }
335
344 private int _blinkRepeatCount;
353 public int BlinkRepeatCount { get => _blinkRepeatCount; set => SetProperty(ref _blinkRepeatCount, value); }
354
363 private double _titleFontSizeValue;
372 public double TitleFontSizeValue { get => _titleFontSizeValue; set => SetProperty(ref _titleFontSizeValue, value); }
373
382 private double _messageFontSizeValue;
391 public double MessageFontSizeValue { get => _messageFontSizeValue; set => SetProperty(ref _messageFontSizeValue, value); }
392
401 public bool OkVisible => !string.IsNullOrEmpty(OkText);
410 public bool CancelVisible => !string.IsNullOrEmpty(CancelText);
411
420 public event EventHandler<bool?>? CloseRequested;
421
430 public ICommand OkCommand { get; }
439 public ICommand CancelCommand { get; }
440
465 public DreamineBlinkPopupWindowViewModel(BlinkPopupOptions opt)
466 {
467 _title = opt.Title;
468 _message = opt.Message;
469 _content = opt.Content;
470 _okText = opt.OkText;
471 _cancelText = opt.CancelText;
472 _rootColor1 = opt.Color1;
473 _rootColor2 = opt.Color2;
474 _foregroundColor = opt.ForegroundColor;
475 _opacity1 = opt.Opacity1;
476 _opacity2 = opt.Opacity2;
477 _blinkIntervalMs = opt.BlinkIntervalMs;
478 _blinkRepeatCount = opt.BlinkRepeatCount;
479 _titleFontSizeValue = opt.TitleFontSize;
480 _messageFontSizeValue = opt.MessageFontSize;
481 _useBlink = opt.UseBlink;
482 _fullscreen = opt.Fullscreen;
483 _topMost = opt.TopMost;
484 IsModal = opt.IsModal;
485 _useContentCard = opt.UseContentCard;
486
487 OkCommand = new RelayCommand(() => CloseRequested?.Invoke(this, true), () => !string.IsNullOrEmpty(OkText));
488 CancelCommand = new RelayCommand(() => CloseRequested?.Invoke(this, false), () => !string.IsNullOrEmpty(CancelText));
489 }
490}